On Tue, Sep 15, 2009 at 11:02:52AM -0400, Tom Lane wrote: > David Fetter <da...@fetter.org> writes: > > I've looked through SQL:2008 (well, through > > 6WD2_02_Foundation_2007-12.pdf), and I didn't find anything that > > implies that the input time zone needs to be retrievable, nor > > anything that would specify the syntax for doing so. > > EXTRACT()?
I see that EXTRACT() can take a time zone as input, but I don't see anywhere that could distinguish among the following inputs, once stored, as they have identical representations in UTC: SELECT now() AS "West Oakland", now() AT TIME ZONE 'UTC' AS "Greenwich", now() AT TIME ZONE 'Asia/Shanghai' AS "Pudong"; West Oakland | Greenwich | Pudong -------------------------------+----------------------------+---------------------------- 2009-09-15 08:27:00.306403-07 | 2009-09-15 15:27:00.306403 | 2009-09-15 23:27:00.306403 (1 row) The way we store TIMESTAMP WITH TIME ZONE, the database converts to UTC, discarding the input time zone in the process. SQL:2008 appears to allow this, and doesn't appear to have a way to retrieve that input time zone once a TIMESTAMP WITH TIME ZONE field has been stored. Cheers, David. -- David Fetter <da...@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers