Re: Nulls in timestamps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Nulls in timestamps
Дата
Msg-id 20422.1121279135@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Nulls in timestamps  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список pgsql-general
Scott Marlowe <smarlowe@g2switchworks.com> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Nulls in timestamps
Следующее
От: Doug Hall
Дата:
Сообщение: Re: Slow delete