diff options
Diffstat (limited to 'src/test/regress/sql/alter_table.sql')
-rw-r--r-- | src/test/regress/sql/alter_table.sql | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index 453799abed4..cba15ebfec8 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -2815,22 +2815,23 @@ ALTER TABLE part_2 DROP COLUMN b; ALTER TABLE part_2 RENAME COLUMN b to c; ALTER TABLE part_2 ALTER COLUMN b TYPE text; --- cannot add/drop NOT NULL or check constraints to *only* the parent, when +-- cannot add NOT NULL or check constraints to *only* the parent, when -- partitions exist ALTER TABLE ONLY list_parted2 ALTER b SET NOT NULL; ALTER TABLE ONLY list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz'); +-- dropping them is ok though ALTER TABLE list_parted2 ALTER b SET NOT NULL; ALTER TABLE ONLY list_parted2 ALTER b DROP NOT NULL; ALTER TABLE list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz'); ALTER TABLE ONLY list_parted2 DROP CONSTRAINT check_b; +-- ... and the partitions should still have both +\d+ part_2 -- It's alright though, if no partitions are yet created CREATE TABLE parted_no_parts (a int) PARTITION BY LIST (a); ALTER TABLE ONLY parted_no_parts ALTER a SET NOT NULL; ALTER TABLE ONLY parted_no_parts ADD CONSTRAINT check_a CHECK (a > 0); -ALTER TABLE ONLY parted_no_parts ALTER a DROP NOT NULL; -ALTER TABLE ONLY parted_no_parts DROP CONSTRAINT check_a; DROP TABLE parted_no_parts; -- cannot drop inherited NOT NULL or check constraints from partition |