Re: BUG #17408: Duplicate aliases silently fail - Mailing list pgsql-bugs

From Pantelis Theodosiou
Subject Re: BUG #17408: Duplicate aliases silently fail
Date
Msg-id CAE3TBxzVw=VFVav=zUo5LyeE+oUiOktOfDbRfDxcA4_6QjWS9g@mail.gmail.com
Whole thread Raw
In response to BUG #17408: Duplicate aliases silently fail  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17408: Duplicate aliases silently fail  (Kevin Potgieter <porturpotgieter@gmail.com>)
List pgsql-bugs
On Wed, Feb 16, 2022 at 10:46 AM PG Bug reporting form
<noreply@postgresql.org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference:      17408
> Logged by:          Kevin Potgieter
> Email address:      porturpotgieter@gmail.com
> PostgreSQL version: 13.6
> Operating system:   Not related
> Description:
>
> Hi,
>
> Assigning aliases to columns works perfectly.
>
> eg. "SELECT name AS customer_name FROM customers"
>
> However you are able to assign duplicate aliases which does not cause a
> conflict
>
> eg. "SELECT name AS customer_name, surname AS customer_name FROM
> customers"
>
> The expectation here is that duplicate aliases would cause the query to fail
> due to duplicate column names in the result, however there is no error or
> warning.

This may look weird but the SQL standard allows it. Postgres is only
following what the standard dictates.

Best regards,
Pantelis Theodosiou

>
> Regards
> Kevin
>



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17408: Duplicate aliases silently fail
Next
From: Kevin Potgieter
Date:
Subject: Re: BUG #17408: Duplicate aliases silently fail