From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ensure that CREATE TABLE LIKE copies any NO INHERIT constraint p
Date: Tue, 10 Mar 2020 18:54:07 +0000
Message-ID: <E1jBk11-0001DN-DG@gemulon.postgresql.org> (raw)
Ensure that CREATE TABLE LIKE copies any NO INHERIT constraint property.
Since the documentation about LIKE doesn't say that a copied constraint
has properties different from the original, it seems that ignoring
a NO INHERIT property doesn't meet the principle of least surprise.
So make it copy that.
(Note, however, that we still don't copy a NOT VALID property;
CREATE TABLE offers no way to do that, plus it seems pointless.)
Arguably this is a bug fix; but no back-patch, as it seems barely
possible somebody is depending on the current behavior.
Ildar Musin and Chris Travers; reviewed by Amit Langote and myself
Discussion: https://postgr.es/m/CAONYFtMC6C+3AWCVp7Yd8H87Zn0GxG1_iQG6_bQKbaqYZY0=-g@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cacef172237fd3426b578f81b7414c0de56cbaaf
Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 11 +++++++----
src/test/regress/expected/create_table_like.out | 16 ++++++++++++++++
src/test/regress/sql/create_table_like.sql | 11 +++++++++++
3 files changed, 34 insertions(+), 4 deletions(-)
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: Ensure that CREATE TABLE LIKE copies any NO INHERIT constraint p
In-Reply-To: <E1jBk11-0001DN-DG@gemulon.postgresql.org>
References: <E1jBk11-0001DN-DG@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