Skip to content

Conversation

@chenjian2664
Copy link
Contributor

Description

Fix #27404

Additional context and related issues

Release notes

() This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

## PostgreSQL
* Add support for `ALTER COLUMN ... SET NOT NULL` statement. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Dec 28, 2025
@github-actions github-actions bot added docs clickhouse ClickHouse connector druid Druid connector ignite Ignite connector mariadb MariaDB connector mysql MySQL connector oracle Oracle connector redshift Redshift connector singlestore SingleStore connector sqlserver SQLServer connector labels Dec 28, 2025
@chenjian2664 chenjian2664 force-pushed the jack/set-column-not-null branch from 87ece51 to f83863e Compare December 28, 2025 08:35
throw semanticException(NOT_SUPPORTED, statement, "Cannot modify hidden column");
}
if (!columnMetadata.isNullable()) {
throw semanticException(NOT_SUPPORTED, statement, "Column is already not nullable");
Copy link
Member

@ebyhr ebyhr Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you confirmed the expected behavior in SQL standard? P.873 in ISO_IEC_9075-2(E)_Foundation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The P.873 doesn't say the behavior if the column is already not nullable, it's depended on the implementation right?

@ebyhr ebyhr changed the title Add support for ALTER COLUMN ... SET NOT NULL in PostgreSQL connector Add support for ALTER COLUMN ... SET NOT NULL in engine and PostgreSQL connector Dec 28, 2025
@chenjian2664 chenjian2664 force-pushed the jack/set-column-not-null branch from f9186f5 to ddd9a6e Compare December 29, 2025 03:29
@github-actions github-actions bot added iceberg Iceberg connector delta-lake Delta Lake connector duckdb DuckDB connector postgresql PostgreSQL connector lakehouse labels Dec 29, 2025
@chenjian2664 chenjian2664 force-pushed the jack/set-column-not-null branch 3 times, most recently from 9944a21 to 4e413fc Compare December 29, 2025 06:38
@github-actions github-actions bot added the memory Memory connector label Dec 29, 2025
@chenjian2664 chenjian2664 force-pushed the jack/set-column-not-null branch 2 times, most recently from 1d8d070 to c4c6661 Compare December 29, 2025 08:32
@chenjian2664 chenjian2664 force-pushed the jack/set-column-not-null branch from c4c6661 to 1195d42 Compare December 29, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed clickhouse ClickHouse connector delta-lake Delta Lake connector docs druid Druid connector duckdb DuckDB connector iceberg Iceberg connector ignite Ignite connector lakehouse mariadb MariaDB connector memory Memory connector mysql MySQL connector oracle Oracle connector postgresql PostgreSQL connector redshift Redshift connector singlestore SingleStore connector sqlserver SQLServer connector syntax-needs-review

Development

Successfully merging this pull request may close these issues.

Support add not-null constraint to an existing column

2 participants