Re: BUG #17408: Duplicate aliases silently fail

From: Kevin Potgieter <porturpotgieter(at)gmail(dot)com>
To: Pantelis Theodosiou <ypercube(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17408: Duplicate aliases silently fail
Date: 2022-02-16 12:05:13
Message-ID: CADfSfvDz1S3-73das+3UZy58ObiWtUe0WK6u=hnWHqWyDd2r-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Is it perhaps and option that postgres could warn you in the same way it
warns you when you do an update without a where clause?

On Wed, 16 Feb 2022, 2:02 pm Pantelis Theodosiou, <ypercube(at)gmail(dot)com>
wrote:

> On Wed, Feb 16, 2022 at 10:46 AM PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
> >
> > The following bug has been logged on the website:
> >
> > Bug reference: 17408
> > Logged by: Kevin Potgieter
> > Email address: porturpotgieter(at)gmail(dot)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
> >
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John Naylor 2022-02-16 12:08:36 Re: BUG #17408: Duplicate aliases silently fail
Previous Message Pantelis Theodosiou 2022-02-16 12:02:12 Re: BUG #17408: Duplicate aliases silently fail