Re: timestamp problem - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: timestamp problem
Date
Msg-id 64F6841A-3760-421A-81FD-7B18195BCFA3@seespotcode.net
Whole thread Raw
In response to Re: timestamp problem  ("Wright, George" <George.Wright@infimatic.com>)
List pgsql-novice
On Oct 31, 2007, at 10:39 , Wright, George wrote:

> myhost=> select isfinite(date '2007-02-29 00:00:01');
> ERROR:  date/time field value out of range: "2007-02-29 00:00:01"

I can see where you're coming from, but I don't necessarily agree.
2007-02-29 is an invalid date, regardless of time zone. 24:00:01 is
an invalid time regardless of time zone. Perhaps this is a question
of not being strict enough on input, but given how often DST and time
zone rules change, I don't think I'd want a situation where
PostgreSQL might accept a particular string as a valid timestamp one
day and reject it the next due to an update of time zone data files.

> as there really shouldn't be an epoch representation of a non-existent
> time. The next epoch second after 2007-10-13 23:59:59 is 2007-10-14
> 01:00:00, not 2007-10-14 00:00:00 in this time zone.

There's no such thing as an epoch second with respect to a time zone.

> This was not the case before I installed the time zone files.
> I believe this shows that the time zone files are installed correctly
> for PostGreSQL.

Well, that would make it appear that what you did properly updated
the time zone data for PostgreSQL. But as you noted, the PostgreSQL
time zone files are different from the systems.

> The name of the function isfinite is a bit vague. Maybe as
> you suggest, its purpose is not really to do a calendar validation.

My question is why did you even think it did? The docs (and the
function name) are pretty clear what it does:

isfinite(timestamp)    boolean    Test for finite time stamp (not equal to
infinity)    isfinite(timestamp '2001-02-16 21:28:30')    true

http://www.postgresql.org/docs/8.2/interactive/functions-
datetime.html#FUNCTIONS-DATETIME-TABLE

Michael Glaesemann
grzm seespotcode net



pgsql-novice by date:

Previous
From: "Wright, George"
Date:
Subject: Re: timestamp problem
Next
From: "Wright, George"
Date:
Subject: Re: timestamp problem