Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: n.lutic@loxodata.com, pgsql-bugs@lists.postgresql.org
Date: 2022-05-20T14:34:20Z
Lists: pgsql-bugs
Daniel Gustafsson <daniel@yesql.se> writes: >> On 19 May 2022, at 14:03, PG Bug reporting form <noreply@postgresql.org> wrote: >> I found something weird. Restoring a view fails if this view contains an >> attribute without alias name. > This is not unique to 14, it can be reproduced further down as well. Yeah, it's an ancient behavior; interesting that no one has complained before. This code in ruleutils is assuming that FigureColname will make the same choice at reload as it did before; which is shaky both because we aren't necessarily printing the identical raw text, and because there's no guarantee we won't change those rules in future. Perhaps we should just tweak ruleutils so that the alias is always printed for non-Var columns, even when it's "?column?". That's kind of ugly, but if you wanted non-ugly you should have selected a better column name to start with. regards, tom lane
Commits
-
Show 'AS "?column?"' explicitly when it's important.
- fefd5463173a 13.8 landed
- f3b8d7244ae1 11.17 landed
- c7461fc25558 15.0 landed
- bb2c04676be0 12.12 landed
- 7686403b43ca 10.22 landed
- 6f7eec1193f8 14.4 landed