Re: Nulls in timestamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Nulls in timestamps
Date: 2005-07-13 17:41:44
Message-ID: 14088.1121276504@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk writes:
> Where does PostgreSQL rank nulls when sorting a column of timestamps, is this
> behaviour deterministic, and can I rely on it not changing in the future?

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.

regression=# (select 1 as x union select null) order by x;
x
---
1

(2 rows)

regression=# (select 1 as x union select null) order by x desc;
x
---

1
(2 rows)

regression=#

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-13 17:46:08 Re: Slow delete
Previous Message TJ O'Donnell 2005-07-13 17:24:01 Re: [SQL] dynamically loaded functions