From: | "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> |
---|---|
To: | "Trevor Talbot" <quension(at)gmail(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us> |
Cc: | "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Timezone database changes |
Date: | 2007-10-09 17:53:42 |
Message-ID: | 470B79D6.EE98.0025.0@wicourts.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>>> On Tue, Oct 9, 2007 at 12:11 PM, in message
<200710091711(dot)l99HB9x15798(at)momjian(dot)us>, Bruce Momjian <bruce(at)momjian(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2007-10-09 18:46:28 | Re: type money causes unrestorable dump |
Previous Message | Andrew Dunstan | 2007-10-09 17:33:33 | Re: Skytools committed without hackers discussion/review |