Обсуждение: BUG #4917: NULLs Last as a Global Option

Поиск
Список
Период
Сортировка

BUG #4917: NULLs Last as a Global Option

От
"MIchael Blake"
Дата:
The following bug has been logged online:

Bug reference:      4917
Logged by:          MIchael Blake
Email address:      michael.blake@webdynamic.com.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

Re: BUG #4917: NULLs Last as a Global Option

От
Tom Lane
Дата:
"MIchael Blake" <michael.blake@webdynamic.com.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