From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix ALTER TABLE code to update domain constraints when needed.
Date: Wed, 01 Nov 2017 17:32:29 +0000
Message-ID: <E1e9wsP-0006Qx-2C@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Fix ALTER TABLE code to update domain constraints when needed.
It's possible for dropping a column, or altering its type, to require
changes in domain CHECK constraint expressions; but the code was
previously only expecting to find dependent table CHECK constraints.
Make the necessary adjustments.
This is a fairly old oversight, but it's a lot easier to encounter
the problem in the context of domains over composite types than it
was before. Given the lack of field complaints, I'm not going to
bother with a back-patch, though I'd be willing to reconsider that
decision if someone does complain.
Patch by me, reviewed by Michael Paquier
Discussion: https://postgr.es/m/30656.1509128130@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/af20e2d728eb508bb169e7294e4e210a3459833a
Modified Files
--------------
src/backend/commands/tablecmds.c | 98 ++++++++++++++++++++++++++++++------
src/backend/utils/adt/ruleutils.c | 67 ++++++++++++++++++++----
src/include/nodes/parsenodes.h | 1 +
src/test/regress/expected/domain.out | 25 +++++++++
src/test/regress/sql/domain.sql | 20 ++++++++
5 files changed, 186 insertions(+), 25 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix ALTER TABLE code to update domain constraints when needed.
In-Reply-To: <E1e9wsP-0006Qx-2C@gemulon.postgresql.org>
References: <E1e9wsP-0006Qx-2C@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