Re: Timezone database changes - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Timezone database changes
Date
Msg-id 470B79D6.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Re: Timezone database changes  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Timezone database changes
List pgsql-hackers
>>> On Tue, Oct 9, 2007 at 12:11 PM, in message
<200710091711.l99HB9x15798@momjian.us>, Bruce Momjian <bruce@momjian.us> wrote:

> Trevor Talbot wrote:
>>
>> Actually, I'm used to knowing how PostgreSQL does it, but looking at
>> things again I remember some confusion I had when first encountering
>> the timestamp types.  I don't know what the SQL Standard says; is the
>> implication that "timestamp with time zone" actually stores the
>> literal time and the zone it is associated with?  (Would make more
>> sense, given the name.)
I don't see how the ANSI functionality can work without it.
>> If that's true, then the current behavior is a bug^H^H^Hdocumented
>> limitation.  I still don't know of anything practical that could be
>> done now, but...
>
> Do we need additional documention about this?
Probably, but we need a lot more than that to conform to the standard
and to avoid surprising behavior.  The first of the two statements
below is valid ANSI syntax to add one day to the current moment.  It
is accepted and generates the wrong value.  The second is the
PostgreSQL way.  It is one of many anomalies.
bigbird=> select current_timestamp, current_timestamp + interval '1' day;             now              |
?column?
-------------------------------+-------------------------------2007-10-09 12:47:18.876498-05 | 2007-10-09
12:47:18.876498-05
(1 row)

bigbird=> select current_timestamp, current_timestamp + interval '1 day';             now              |
?column?
-------------------------------+-------------------------------2007-10-09 12:47:20.190999-05 | 2007-10-10
12:47:20.190999-05
(1 row)
-Kevin



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Skytools committed without hackers discussion/review
Next
From: Gregory Stark
Date:
Subject: Re: type money causes unrestorable dump