From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: n.lutic@loxodata.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
Date: Fri, 20 May 2022 10:34:20 -0400
Message-ID: <334334.1653057260@sss.pgh.pa.us> (raw)
In-Reply-To: <792E8C73-EBE0-41FC-A83F-2F7A7AF4ABBB@yesql.se>
References: <17486-1ad6fd786728b8af@postgresql.org>
<792E8C73-EBE0-41FC-A83F-2F7A7AF4ABBB@yesql.se>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, n.lutic@loxodata.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
In-Reply-To: <334334.1653057260@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox