Re: BUG #1335: Wrong sort result in union queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1335: Wrong sort result in union queries
Дата
Msg-id 8560.1101916469@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1335: Wrong sort result in union queries  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Union isn't a tool which gives you that ability. Union All is closer, but
> still doesn't guarantee an order.

The current implementation of UNION ALL will in fact act that way (just
append the individual query results together), but if for some reason we
decide to change it later, we'll be within the spec to do so.  (I can't
imagine a reason to change it though...)

> This one is also okay. The order by in one wing does not control the
> output of the union. I believe supporting it is an extension in any case
> (at least SQL92 seems to make it illegal)

Yes.  SQL92 believes strongly that row order is not significant, except
at the top level output of a query with ORDER BY ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1332: wrong results from age function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1332: wrong results from age function