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

From David Johnston
Subject Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Date
Msg-id 014f01cd637e$0a4a4100$1edec300$@yahoo.com
Whole thread Raw
In response to Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)  (Alban Hertroys <haramrae@gmail.com>)
Responses 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>)
List 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 by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Next
From: Sergey Konoplev
Date:
Subject: Re: Replication/cloning: rsync vs modification dates?