From 4a02af8b1a5f3f8221c7381bc4de08a3d830f682 Mon Sep 17 00:00:00 2001 From: Álvaro Herrera Date: Thu, 27 Mar 2025 09:24:52 +0100 Subject: 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 Reviewed-by: Suraj Kharage Discussion: https://postgr.es/m/202503251602.vsxaehsyaoac@alvherre.pgsql --- doc/src/sgml/ref/alter_table.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 4f15b89a98f..11d1bc7dbe1 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -59,7 +59,7 @@ ALTER TABLE [ IF EXISTS ] name ADD table_constraint [ NOT VALID ] ADD table_constraint_using_index ALTER CONSTRAINT constraint_name [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] - ALTER CONSTRAINT constraint_name SET [ INHERIT | NO INHERIT ] + ALTER CONSTRAINT constraint_name [ INHERIT | NO INHERIT ] VALIDATE CONSTRAINT constraint_name DROP CONSTRAINT [ IF EXISTS ] constraint_name [ RESTRICT | CASCADE ] DISABLE TRIGGER [ trigger_name | ALL | USER ] @@ -564,8 +564,8 @@ WITH ( MODULUS numeric_literal, REM - ALTER CONSTRAINT ... SET INHERIT - ALTER CONSTRAINT ... SET NO INHERIT + ALTER CONSTRAINT ... INHERIT + ALTER CONSTRAINT ... NO INHERIT These forms modify a inheritable constraint so that it becomes not -- cgit v1.2.3