Re: configure postgtresql to order NULLS FIRST instead of thedefault NULLS LAST

Поиск
Список
Период
Сортировка
От Jay Riddle
Тема Re: configure postgtresql to order NULLS FIRST instead of thedefault NULLS LAST
Дата
Msg-id 1799053763.6104245.1546597877186@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: configure postgtresql to order NULLS FIRST instead of the defaultNULLS LAST  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Ответы RE: configure postgtresql to order NULLS FIRST instead of the defaultNULLS LAST  ("Vianello, Daniel A" <Daniel.Vianello@charter.com>)
Список pgsql-novice
Maybe something like this will work for you

....ORDER BY CASE WHEN SomeColumn IS NULL THEN 1 ELSE 0 END, SomeColumn



From: Vik Fearing <vik.fearing@2ndquadrant.com>
To: David G. Johnston <david.g.johnston@gmail.com>; john snow <ofbizfanster@gmail.com>
Cc: pgsql-novice <pgsql-novice@postgresql.org>
Sent: Friday, January 4, 2019 1:33 AM
Subject: Re: configure postgtresql to order NULLS FIRST instead of the default NULLS LAST

On 04/01/2019 08:09, David G. Johnston wrote:
> On Thursday, January 3, 2019, john snow <ofbizfanster@gmail.com
> <mailto:ofbizfanster@gmail.com>> wrote:

>
>    is there a setting that is available for me to use to configure
>    Postgresql to order NULLS FIRST by default instead of NULLS LAST?
>
>
> No there is not and likely never will be as such an option introduces
> undesirable variability.



That, and the spec forbids it.

"If <null ordering> is not specified, then an implementation-defined
<null ordering> is implicit. The implementation-defined default for
<null ordering> shall not depend on the context outside of <sort
specification list>."
--
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support




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

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: configure postgtresql to order NULLS FIRST instead of the defaultNULLS LAST
Следующее
От: Stephen Froehlich
Дата:
Сообщение: WAL on zfs Settings