Re: Constraint's NO INHERIT option is ignored in CREATE TABLE LIKE statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ildar Musin <ildar(at)adjust(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Constraint's NO INHERIT option is ignored in CREATE TABLE LIKE statement
Date: 2020-02-19 23:02:21
Message-ID: 30005.1582153341@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ildar Musin <ildar(at)adjust(dot)com> writes:
> My colleague Chris Travers discovered something that looks like a bug.
> Let's say we have a table with a constraint that is declared as NO INHERIT.
> ...
> Now when we want to make a copy of the table structure into a new table
> the `NO INHERIT` option is ignored.

Hm, I agree that's a bug, since the otherwise-pretty-detailed CREATE TABLE
LIKE documentation makes no mention of such a difference between original
and cloned constraint.

However, I'd be disinclined to back-patch, since it's barely possible
somebody out there is depending on the existing behavior.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-02-19 23:20:19 Re: Constraint's NO INHERIT option is ignored in CREATE TABLE LIKE statement
Previous Message Peter Geoghegan 2020-02-19 22:57:12 Re: Delaying/avoiding BTreeTupleGetNAtts() call within _bt_compare()