BUG #4917: NULLs Last as a Global Option

Lists: pgsql-bugs
From: "MIchael Blake" <michael(dot)blake(at)webdynamic(dot)com(dot)au>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4917: NULLs Last as a Global Option
Date: 2009-07-12 23:48:30
Message-ID: 200907122348.n6CNmU5j003985@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4917
Logged by: MIchael Blake
Email address: michael(dot)blake(at)webdynamic(dot)com(dot)au
PostgreSQL version: 8.3
Operating system: Linux [Ubuntu 9.04]
Description: NULLs Last as a Global Option
Details:

Could an option be added to postgresql.conf for default ordering of NULL
values for different sort orders? That is, I'd like to be able to force
NULLs to be last for date types and number types for descending, but first
for ascending - the trick is I'd like this to be the default globally.

For example:

null_ordering_asc = first
null_ordering_desc = last


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "MIchael Blake" <michael(dot)blake(at)webdynamic(dot)com(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4917: NULLs Last as a Global Option
Date: 2009-07-13 05:02:40
Message-ID: 25394.1247461360@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"MIchael Blake" <michael(dot)blake(at)webdynamic(dot)com(dot)au> writes:
> Could an option be added to postgresql.conf for default ordering of NULL
> values for different sort orders?

It could be, but whether it will be is an entirely different question.
I think by and large we've discovered that GUC variables that alter the
defined semantics of SQL commands are not such a great idea. In any
case, you'd have to wait at least a year to solve your problem that
way, so fixing it on the client side is probably a better plan.

regards, tom lane