Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Дата
Msg-id 014f01cd637e$0a4a4100$1edec300$@yahoo.com
обсуждение исходный текст
Ответ на Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)  (Alban Hertroys <haramrae@gmail.com>)
Ответы Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)  (Rafal Pietrak <rafal@zorro.isa-geek.com>)
Список pgsql-general
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Alban Hertroys
> Sent: Monday, July 16, 2012 1:44 PM
> To: Daniele Varrazzo
> Cc: Craig Ringer; Chris Bartlett; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Can't figure out how to use now() in default for
> tsrange column (PG 9.2)
> That said, if it were up to me to decide what the proper epoch value would
> be for infinity, I'd say NULL - it is unknown as computers simply can't
count
> far enough. It's probably only a matter of time until someone thinks of a
> solution for that though.
>

Given:
A) extract() returns a "double precision"
B) "... In addition to ordinary numeric values, the floating-point types
have several special values: ... 'Infinity ..."

I would vote that the epoch result should be "Infinity".

Specific, but unknown (e.g., day of week, month, year, etc...) results could
return "NaN" though "NULL" is also, probably more, reasonable given the
context.

The goal would be to use "Infinity" in case where "<>" comparisons are
common and use "NULL" where "=" comparisons are common.

Personally I'd prefer to generate an error in places where "NULL" would be
the result in order to minimize bugs.

David J.









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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Следующее
От: Sergey Konoplev
Дата:
Сообщение: Re: Replication/cloning: rsync vs modification dates?