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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org, tom@intevation.de, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Date: 2020-08-22T01:41:21Z
Lists: pgsql-bugs
On Thu, Aug 20, 2020 at 03:18:24PM -0400, Tom Lane wrote:
> So attached is a complete fix for the issues discussed in this thread.
> 
> Although I originally felt that we weren't going to be able to create
> a back-patchable fix, this seems much less invasive than my prior
> attempt, so I think it might be reasonable to back-patch.  The only
> external API break is the new AT_CookedColumnDefault subcommand,
> which we could stick at the end of the enum in stable branches.
> 
> Thoughts?

For the archive's sake, this has been committed as of 5028981,
backpatched down to 9.5.
--
Michael

Commits

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

  2. Fix handling of CREATE TABLE LIKE with inheritance.