Search Postgresql Archives

Re: Nulls in timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott Marlowe <smarlowe@xxxxxxxxxxxxxxxxx> writes:
> On Wed, 2005-07-13 at 12:41, Tom Lane wrote:
>> Nulls sort high (in any datatype, not only timestamps).  It's possible
>> that we'd offer an option to make them sort low in the future, but I
>> can't imagine that we'd change the default behavior.

> Isn't this behaviour implementation dependent, i.e. other database could
> do it anyway they wanted?  Just thinking of portability issues one might
> have if one were to rely on null sort order in an application.

According to the SQL spec it's "implementation defined", which means
different DBs could do it differently but they have to tell you what
they will do.  "Implementation dependent" effectively means "the
behavior is not specified at all".

For instance, in SQL92 13.1 <declare cursor> general rule 3(b):

              Whether a sort key value that is null is considered greater
              or less than a non-null value is implementation-defined, but
              all sort key values that are null shall either be considered
              greater than all non-null values or be considered less than
              all non-null values.


			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux