BUG #19003: A SELECT that does not return a valid table - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #19003: A SELECT that does not return a valid table
Date
Msg-id 19003-17a559220b959ea1@postgresql.org
Whole thread Raw
Responses Re: BUG #19003: A SELECT that does not return a valid table
Re: BUG #19003: A SELECT that does not return a valid table
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      19003
Logged by:          Alexandre Bailly
Email address:      alexandrebailly1955@gmail.com
PostgreSQL version: 17.5
Operating system:   Windows
Description:

SELECT 'John' AS nom,'James' AS nom
returns a table with attributes nom and nom that I can see in the output.
The table is invalid because
SELECT nom FROM (SELECT 'John' AS nom,'James' AS nom)
returns
ERROR:  column reference "nom" is ambiguous
LINE 1: SELECT nom FROM (SELECT 'John' AS nom,'James' AS nom).
Returning a table that contains twice the same column should not be
permitted. It should be a nice mathematical property (closure) if a SELECT
always returns a valid table.
Remark:
CREATE TABLE customer
(
nom text,
nom text
);
returns
ERROR:  column "nom" specified more than once.


pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Postgres: Queries are too slow after upgrading to PG17 from PG15
Next
From: Todd Cook
Date:
Subject: Re: Postgres: Queries are too slow after upgrading to PG17 from PG15