Re: Non-standard TIMESTAMP WITH TIME ZONE literal handling - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: Non-standard TIMESTAMP WITH TIME ZONE literal handling
Date
Msg-id 20030807082209.M34664-100000@megazone.bigpanda.com
Whole thread Raw
In response to Non-standard TIMESTAMP WITH TIME ZONE literal handling  (Troels Arvin <troels@arvin.dk>)
List pgsql-bugs
On Thu, 7 Aug 2003, Troels Arvin wrote:

> Hello,
>
> In Jim Melton and Alan Simon's "SQL:1999 - Understanding Relational
> Language Components" (ISBN 1-55860-456-1), they write that the following
> is to be interpreted as a TIMESTAMP WITH TIME ZONE value:
>
> TIMESTAMP '2003-07-29 13:19:30.5+02:00'
>
> PostgreSQL interprets the above as a TIMESTAMP WITHOUT TIME ZONE value of
> '2003-07-29 13:19:30.5', i.e. it simply discards the '+02:00' part and
> fails to interpret it as being of TIMESTAMP WITH TIME ZONE type.
>
> Unless Melton+Simon are wrong, PostgreSQL is not completely following
> SQL:1999 regarding TIMESTAMP-like literal parsing.

I think they're correct and we're wrong:

SQL92 5.3 Syntax rules:
17)The data type of a <timestamp literal> that does not specify
<time zone interval> is TIMESTAMP(P), where P is the number of
digits in <seconds fraction>, if specified, and 0 otherwise.
The data type of a <timestamp literal> that specifies <time zone
interval> is TIMESTAMP(P) WITH TIME ZONE, where P is the number
of digits in <seconds fraction>, if specified, and 0
otherwise.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Non-standard TIMESTAMP WITH TIME ZONE literal handling
Next
From: Christian van der Leeden
Date:
Subject: Re: Follow up: range query with timestamp returns different result with index than without (7.3.3)