Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT
authorÁlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 27 Mar 2025 08:24:52 +0000 (09:24 +0100)
committerÁlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 27 Mar 2025 08:24:52 +0000 (09:24 +0100)
commit4a02af8b1a5f3f8221c7381bc4de08a3d830f682
tree3d0b6fbd5e0e582495a3f4584b86498705c49c20
parent72c2f36d572763201430a35414138c1b9ec3a106
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
doc/src/sgml/ref/alter_table.sgml
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/test/regress/expected/foreign_key.out
src/test/regress/expected/inherit.out
src/test/regress/sql/inherit.sql