Re: BUG #16272: Index expression can refer to wrong attributes if index is created via CREATE TABLE LIKE

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, pgsql-bugs@lists.postgresql.org, tom@intevation.de, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Date: 2020-09-13T16:53:02Z
Lists: pgsql-bugs
Alexander Lakhin <exclusion@gmail.com> writes:
> When executing the following query:
> CREATE TABLE test(i int CHECK (i > 0));
> CREATE TABLE pg_user(LIKE test INCLUDING CONSTRAINTS);
> I get an assertion:

Fixed, thanks for the report!

			regards, tom lane



Commits

  1. Use the properly transformed RangeVar for expandTableLikeClause().

  2. Fix handling of CREATE TABLE LIKE with inheritance.