Re: Nulls in timestamps

Поиск
Список
Период
Сортировка
От markMLl.pgsql-general@telemetry.co.uk
Тема Re: Nulls in timestamps
Дата
Msg-id 42D55A30.6E78564A@telemetry.co.uk
обсуждение исходный текст
Ответ на Nulls in timestamps  (markMLl.pgsql-general@telemetry.co.uk)
Ответы Re: Nulls in timestamps  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Many thanks Tom. Inconvenient from the point of view of the application but
still useful information.

The situation is that I've got a query with numerous subselects, each of which
has to return exactly one row so I was doing a union with a nulled record then
selecting the most recent: obviously I need to see bona-fide data if it's there.

What I'll do is teach the app or the users to ignore a specified early data,
e.g. 1970-01-01.

Again, many thanks (and boy, is it good to have that gateway working properly
:-)


Tom Lane wrote:
>
> markMLl.pgsql-general@telemetry.co.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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: fts error
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Nulls in timestamps