Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
Date
Msg-id 334334.1653057260@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
List 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



pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands
Next
From: Tom Lane
Date:
Subject: Re: Unable to connect to PostgreSQL DB as root user when private key is owned by root with permission 640