Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT
Álvaro Herrera <alvherre@alvh.no-ip.org>
Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT Commit d45597f72fe5 introduced the ability to change a not-null constraint from NO INHERIT to INHERIT and vice versa, but we included the SET noise word in the syntax for it. The SET turns out not to be necessary and goes against what the SQL standard says for other ALTER TABLE subcommands, so remove it. This changes the way this command is processed for constraint types other than not-null, so there are some error message changes. Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Suraj Kharage <suraj.kharage@enterprisedb.com> Discussion: https://postgr.es/m/202503251602.vsxaehsyaoac@alvherre.pgsql
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +3 −3 |
| src/backend/commands/tablecmds.c | modified | +1 −1 |
| src/backend/parser/gram.y | modified | +8 −18 |
| src/test/regress/expected/foreign_key.out | modified | +1 −3 |
| src/test/regress/expected/inherit.out | modified | +15 −15 |
| src/test/regress/sql/inherit.sql | modified | +15 −15 |
Documentation touched
Discussion
- simplifying grammar for ALTER CONSTRAINT .. SET [NO] INHERIT 5 messages · 2025-03-25 → 2025-03-27