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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: n(dot)lutic(at)loxodata(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
Date: 2022-05-20 14:34:20
Message-ID: 334334.1653057260@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>> On 19 May 2022, at 14:03, PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-05-20 14:49:46 Re: Unable to connect to PostgreSQL DB as root user when private key is owned by root with permission 640
Previous Message Alvaro Herrera 2022-05-20 14:12:01 Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands