[docs] revise ORDER BY documentation

Поиск
Список
Период
Сортировка
От Dian Fay
Тема [docs] revise ORDER BY documentation
Дата
Msg-id CZJTMBYACP97.2RN8B7OBOYXVJ@nmfay.com
обсуждение исходный текст
Список pgsql-hackers
I recently encountered some odd behavior with a query both selecting and
sorting by `random()`. When I posted about it on pgsql-bugs ^1, David
Johnston and Tom Lane provided some very detailed explanations as to
what was happening, but weren't sure whether or where information about
it could live comfortably in the docs. I think it's a useful addition;
it's not an everyday occurrence but I'm very much not the first person
to run into it. After a bit of looking, I think I've found a reasonable
location.

This patch revises
https://www.postgresql.org/docs/current/queries-order.html to discuss
sort expressions and options separately, and fits a caveat based on
Tom's suggested language (with an example) into the former section.

There are a few other minor tweaks included here:

- note that `*` is not an expression
- consolidate output column examples
- mention non-column sort expressions

I did write a query demonstrating the `group by` case Tom mentioned, but
expect that one's a lot less common.

1: https://www.postgresql.org/message-id/CZHAF947QQQO.27MAUK2SVMBXW%40nmfay.com

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Documentation: warn about two_phase when altering a subscription
Следующее
От: John Naylor
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum