Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: branko(dot)radovanovic(dot)zg(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY
Date: 2023-03-19 01:11:21
Message-ID: CAKFQuwZwrTDx0=GwETi21BKjhioeWT=xe9Xm-8+79gFBOAOzRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Mar 18, 2023 at 5:56 PM Vik Fearing <vik(at)postgresfriends(dot)org> wrote:

> On 3/18/23 23:44, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference: 17853
> > Logged by: Branko Radovanovic
> > Email address: branko(dot)radovanovic(dot)zg(at)gmail(dot)com
> > PostgreSQL version: 13.4
> > Operating system: Debian
> > Description:
> >
> > The following SQL:
> >
> > values ('a')
> > order by 1 collate "C";
> >
> > ...returns an error: SQL Error [42804]: ERROR: collations are not
> supported
> > by type integer
> >
> > In the above query, "1" is not an integer but a column reference, so it
> > should be treated as well-formed and work the same as with the actual
> column
> > label:
>
> There is an argument that this should work. There is also an argument
> that using numerical column references is not (or rather, is no longer)
> Standard SQL and should not be used.
>
>
So we also have a documentation bug for failing to accurately indicate that
our treatment here is non-standard. Given the existing notes that refer to
both SQL-92 and SQL:1999 explicitly and make no mention of this I'd have to
assume such a material difference falls into the scope of things we
document.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2023-03-19 01:27:54 Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY
Previous Message Vik Fearing 2023-03-19 00:55:58 Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY