Re: timestamps and dates - Mailing list pgsql-general

From Tom Lane
Subject Re: timestamps and dates
Date
Msg-id 26194.1051624602@sss.pgh.pa.us
Whole thread Raw
In response to Re: timestamps and dates  (Antti Haapala <antti.haapala@iki.fi>)
List pgsql-general
Antti Haapala <antti.haapala@iki.fi> writes:
>> So zones in 'right' folder have leap second support on. The difference is
>> correct - 22 (i had it wrong before), the number of leap seconds inserted
>> since UTC Epoch on 1 Jan 1972.

Yeah.  That's the second report we've had of systems running in a
leap-second zone by default.  I think it would be a good idea for
Postgres to check for this situation and complain.  But how strongly
should it complain?  Refuse to start up?  Adopt GMT instead?  What if
asking for GMT gets a leap-second zone?

> ilmo=# select '1998-31-12 23:59:60 UTC'::timestamp with time zone;
> ERROR:  Bad timestamp external representation '1998-31-12 23:59:60 UTC'

> My timestamp surely is legal according to ISO-8601.

That's a good point.  We got complaints about this all the time back
when we had roundoff problems in that code, but no one ever stopped to
point out that such a timestamp actually is legal per spec.  (Strictly
speaking I think :60 should only be accepted at points where there
actually was a leap second, but we're not gonna check for that...)

            regards, tom lane


pgsql-general by date:

Previous
From: Sergio Pili
Date:
Subject: Re: Error: No one parent tuple was found
Next
From: Jeff Eckermann
Date:
Subject: Re: Fwd: Re: Selecting the most recent date