pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: asier.lostale@openbravo.com
Subject: BUG #18038: Aliases removed from view definitions
Date: Thu, 27 Jul 2023 06:29:32 +0000
Message-ID: <18038-c1613c6a9be9995d@postgresql.org> (raw)

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;



view thread (5+ messages)  latest in thread

Message-ID: <18038-c1613c6a9be9995d@postgresql.org>
Permalink:  ../18038-c1613c6a9be9995d@postgresql.org/
Also on:    postgresql.org/message-id/18038-c1613c6a9be9995d@postgresql.org

 · 

reply

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, asier.lostale@openbravo.com
  Subject: Re: BUG #18038: Aliases removed from view definitions
  In-Reply-To: <18038-c1613c6a9be9995d@postgresql.org>

* 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