Re: Global setting for ORDER BY ... NULLS FIRST / LAST

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Sebastien Flaesch <sebastien(dot)flaesch(at)4js(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Global setting for ORDER BY ... NULLS FIRST / LAST
Date: 2022-03-01 14:41:48
Message-ID: CAKFQuwY-dmsURUBHqjbrMN6vtezExhZYzHHUU_GSNgwWABisOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Mar 1, 2022 at 7:16 AM Sebastien Flaesch <sebastien(dot)flaesch(at)4js(dot)com>
wrote:

> Is there a global PostgreSQL server setting or SQL session parameter that
> defines the default for ORDER BY ... NULLS FIRST / LAST ?
>

Nope

Assuming that it would be something like "NULL is lowest value, or NULL is
> highest value", to get the expected behavior when using ASC/DESC options of
> ORDER BY ...
>

I don't think I quite follow the above, but may I suggest you read our
excellent documentation on how the feature presently functions before
making suggestions on how to change it.

> That would help to migrate to PostgreSQL for DB engines having a different
> default behavior regarding NULL sorting.
>

IMO, not enough of a benefit to spend development time on. Having global
configuration like this is something that should be, and in general is,
avoided. Most of the exceptions to this have been regretted.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2022-03-01 15:02:26 Re: Global setting for ORDER BY ... NULLS FIRST / LAST
Previous Message Sebastien Flaesch 2022-03-01 14:16:23 Global setting for ORDER BY ... NULLS FIRST / LAST