pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add ATAlterConstraint struct for ALTER .. CONSTRAINT
Date: Wed, 19 Feb 2025 12:09:53 +0000
Message-ID: <E1tkitm-000839-25@gemulon.postgresql.org> (raw)

Add ATAlterConstraint struct for ALTER .. CONSTRAINT

Replace the use of Constraint with a new ATAlterConstraint struct, which
allows us to pass additional information.  No functionality is added by
this commit.  This is necessary for future work that allows altering
constraints in other ways.

I (Álvaro) took the liberty of restructuring the code for ALTER
CONSTRAINT beyond what Amul did.  The original coding before Amul's
patch was unnecessarily baroque, and this change makes things simpler
by removing one level of subroutine.  Also, partly remove the assumption
that only partitioned tables are relevant (by passing sensible 'recurse'
arguments) and no longer ignore whether ONLY was specified.  I say
'partly' because the current coding only walks down via the 'conparentid'
relationship, which is only used for partitioned tables; but future
patches could handle ONLY or not for other types of constraint changes
for legacy inheritance trees too.

Author: Amul Sul <sulamul@gmail.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/CAAJ_b94bfgPV-8Mw_HwSBeheVwaK9=5s+7+KbBj_NpwXQFgDGg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/80d7f990496b1c7be61d9a00a2635b7d96b96197

Modified Files
--------------
src/backend/commands/tablecmds.c | 179 ++++++++++++++++++---------------------
src/backend/parser/gram.y        |   4 +-
src/include/nodes/parsenodes.h   |  25 ++++--
src/tools/pgindent/typedefs.list |   1 +
4 files changed, 103 insertions(+), 106 deletions(-)



Message-ID: <E1tkitm-000839-25@gemulon.postgresql.org>
Permalink:  ../E1tkitm-000839-25@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tkitm-000839-25@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add ATAlterConstraint struct for ALTER .. CONSTRAINT
  In-Reply-To: <E1tkitm-000839-25@gemulon.postgresql.org>

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

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