public inbox for [email protected]  
help / color / mirror / Atom feed
From: Álvaro Herrera <[email protected]>
To: [email protected]
Subject: pgsql: Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT
Date: Thu, 27 Mar 2025 08:25:39 +0000
Message-ID: <[email protected]> (raw)

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 <[email protected]>
Reviewed-by: Suraj Kharage <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4a02af8b1a5f3f8221c7381bc4de08a3d830f682

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml         |  6 +++---
src/backend/commands/tablecmds.c          |  2 +-
src/backend/parser/gram.y                 | 26 ++++++++------------------
src/test/regress/expected/foreign_key.out |  4 +---
src/test/regress/expected/inherit.out     | 30 +++++++++++++++---------------
src/test/regress/sql/inherit.sql          | 30 +++++++++++++++---------------
6 files changed, 43 insertions(+), 55 deletions(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox