From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Ensure that CREATE TABLE LIKE copies any NO INHERIT constraint p |
Date: | 2020-03-10 18:54:07 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
master
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2020-03-10 21:16:47 | pgsql: nbtree: Demote minus infinity "can't happen" error. |
Previous Message | Tom Lane | 2020-03-10 16:46:12 | pgsql: Avoid portability problem introduced in 0a42a2e9c. |