Skip site navigation (1) Skip section navigation (2)

NULLs and sort order

From: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: NULLs and sort order
Date: 2001-09-09 12:50:35
Message-ID: g6nmptooueb7tn3pga089ihc3csge15i19@4ax.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
The JDBC driver's test suite currently fails on DatabaseMetaData
methods that provide information about NULLs and sort order.
I've looked through the documentation, but couldn't find
anything about it.

The JDBC driver returns different values, depending on the
backend version (<7.2 vs. >= 7.2), so this suggests something
changed recently. This is probably also the cause of the test
suite failure, since the test case has no conditional coding for
different backend versions. So presumably, the test suite needs
to be updated, but I wanted to doublecheck the functionality on
this list.

What we need to know is:
- Do null values sort higher or lower than any other value in a
domain? Higher would mean that null values appear at the end in
an ascending sort order.
- Will null values appear at the start or the end regardless of
the sort order?

Currently the JDBC driver says:
- Backend >= 7.2 sorts nulls higher than any other value in a
domain. In other words: ascending means nulls at the end,
descending means nulls at the start.
- Backend < 7.2 puts nulls at the end regardless of sort order.

Can someone confirm if this is correct? 

Would it be useful to add this information to the documentation,
e.g. the documentation of ORDER BY in SELECT?

Regards,
René Pijlman <rene(at)lab(dot)applinet(dot)nl>

Responses

pgsql-hackers by date

Next:From: Rene PijlmanDate: 2001-09-09 12:58:40
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS tip
Previous:From: Jim ButtafuocoDate: 2001-09-09 12:50:33
Subject: pg_dump -C option

pgsql-jdbc by date

Next:From: Rene PijlmanDate: 2001-09-09 12:58:40
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS tip
Previous:From: Jeroen van VianenDate: 2001-09-09 12:48:41
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group