From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Cc: | alexandrebailly1955(at)gmail(dot)com |
Subject: | BUG #19003: A SELECT that does not return a valid table |
Date: | 2025-07-30 19:20:14 |
Message-ID: | 19003-17a559220b959ea1@postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 19003
Logged by: Alexandre Bailly
Email address: alexandrebailly1955(at)gmail(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Todd Cook | 2025-07-30 19:48:55 | Re: Postgres: Queries are too slow after upgrading to PG17 from PG15 |
Previous Message | Peter Geoghegan | 2025-07-30 19:16:42 | Re: Postgres: Queries are too slow after upgrading to PG17 from PG15 |