Re: BUG #18589: pg_get_viewdef returns wrong query - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #18589: pg_get_viewdef returns wrong query
Date
Msg-id CAMbWs4_nMJ8uXMxd8T7eUh3DbNa9DbNM9_CpuQN5Yk74SUaEEg@mail.gmail.com
Whole thread Raw
In response to BUG #18589: pg_get_viewdef returns wrong query  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18589: pg_get_viewdef returns wrong query
List pgsql-bugs
On Mon, Aug 26, 2024 at 7:22 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
> In PostgreSQL 16.3, after I created a view by a statement like
> "create view kvview as select key as value, value as key from kv order by
> value",
> I retrieved a different definition from information_schema.views
> "SELECT key AS value, value AS key FROM kv ORDER BY key".
> I expect ORDER BY column be value.
>
> I tried the same in PostgreSQL 14.12 and 15.7 and got correct equivalent
> definitions.
> "SELECT keyvalue.key AS value, keyvalue.value AS key FROM keyvalue ORDER BY
> keyvalue.key"
>
> So this seems to be a regression.

This is broken starting from 1b4d280ea.  The "new" and "old" entries
in a view's rangetable were removed, which results in the varprefix
flag being set to false in this case, as there is now only one rtable
entry.

Thanks
Richard



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18590: during pg14 to pg15 migration , old passwords not migrated to scram-sha from md5
Next
From: Tom Lane
Date:
Subject: Re: BUG #18590: during pg14 to pg15 migration , old passwords not migrated to scram-sha from md5