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.