Re: Case in Order By Ignored without warning or error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Case in Order By Ignored without warning or error
Дата
Msg-id 19406.1465396372@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Case in Order By Ignored without warning or error  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-bugs
Francisco Olarte <folarte@peoplecall.com> writes:
> On Wed, Jun 8, 2016 at 10:39 AM, Emiel Hermsen <s32191234@gmail.com> wrote:
>> The second option, again just my opinion, would be to change the behavior
>> where the ORDER BY clause refuses any contained content other than numbers
>> and column names combined with the ASC and DESC keywords.

> I *strongly* disagree with that.

Yeah, there is very little chance we'd change the behavior here.  Some
context might help: the behavior whereby ORDER BY's arguments are names
or numbers of output columns was mandated in SQL92.  SQL99, and more
recent iterations of the standard, redefined ORDER BY's arguments as
being arbitrary expressions over the input columns.  Postgres attempts
to be compatible with both of those interpretations.  There's no way that
we would drop the SQL99 behavior, because that's required by current
spec.  Dropping the SQL92 behavior is also unpleasant to contemplate,
because it would break a lot of legacy code, and frankly "ORDER BY 1"
is just too convenient a shorthand to give up easily.  So we live with
the fact that the behavior is a bit ambiguous.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Emiel Hermsen
Дата:
Сообщение: Re: Case in Order By Ignored without warning or error
Следующее
От: Sandro Santilli
Дата:
Сообщение: lower integer bound not supported