BUG #18038: Aliases removed from view definitions - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18038: Aliases removed from view definitions
Date
Msg-id 18038-c1613c6a9be9995d@postgresql.org
Whole thread Raw
Responses Re: BUG #18038: Aliases removed from view definitions
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18038
Logged by:          Asier Lostalé
Email address:      asier.lostale@openbravo.com
PostgreSQL version: 16beta2
Operating system:   Ubuntu 22.04
Description:

When defining a view in 16beta2, the sql representing that view removes
aliases. In previous versions those aliases where kept; furthermore, aliases
were added even if not defined.

In our case this is problematic as in our application we export view
definitions to text files to later import them, we support different
PostgreSQL versions and we would need to keep stable SQL among different
version (export <-> import).

For example:

create table test (c text);
create view test_v as select c from test;
create view test_v2 as select t.c from test t;

In PostgreSQL 16beta2:

\d+ test_v
 ...
View definition:
 SELECT c
   FROM test;


\d+ test_v2 
...
View definition:
 SELECT c
   FROM test t;

In previous versions:

\d+ test_v
...
View definition:
 SELECT test.c
   FROM test;

\d+ test_v2
...
View definition:
 SELECT t.c
   FROM test t;


pgsql-bugs by date:

Previous
From: Gurjeet Singh
Date:
Subject: Fwd: BUG #18016: REINDEX TABLE failure
Next
From: Ba Jinsheng
Date:
Subject: Question about double table scans for a table