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