From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: alexandrebailly1955@gmail.com
Subject: BUG #19003: A SELECT that does not return a valid table
Date: Wed, 30 Jul 2025 19:20:14 +0000
Message-ID: <19003-17a559220b959ea1@postgresql.org> (raw)
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.
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, alexandrebailly1955@gmail.com
Subject: Re: BUG #19003: A SELECT that does not return a valid table
In-Reply-To: <19003-17a559220b959ea1@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