Re: Seemingly inconsistent ORDER BY behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Hipp <drh(at)sqlite(dot)org>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Seemingly inconsistent ORDER BY behavior
Date: 2013-08-14 20:12:18
Message-ID: 14022.1376511138@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Hipp <drh(at)sqlite(dot)org> writes:
> Just to be clear, you intend that a COLLATE clause in the ORDER BY is
> treated as an expression, right?

Yeah, that is the current behavior, although I think that it probably fell
out rather than being consciously thought about. Arguably it's the wrong
thing, because it looks to me like SQL92 allowed

select ... order by 1 collate "something"

which our current code will interpret as ordering by a constant (and then
complain that you can't collate an int...). Don't know if it's worth
changing --- we have our own backwards-compatibility concerns to think
about, and there haven't been any field complaints about this. I doubt
there's any pressure at this point to become more compatible with SQL92,
as opposed to more compatible with later editions.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2013-08-14 21:00:34 Re: Getting list of supported types in Postgres
Previous Message rob stone 2013-08-14 19:57:41 Re: Seemingly inconsistent ORDER BY behavior