>>> On Tue, Oct 9, 2007 at 12:11 PM, in message
<[EMAIL PROTECTED]>, Bruce Momjian <[EMAIL PROTECTED]> 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)

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to