SELECT TIMESTAMP WITH TIME ZONE ... AT TIME ZOME as inverted meaning with UTC times...

From: "Andreas Schultz" <andreas(dot)schultz(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SELECT TIMESTAMP WITH TIME ZONE ... AT TIME ZOME as inverted meaning with UTC times...
Date: 2007-05-08 15:33:00
Message-ID: b1828db40705080833p3347dfc6q30a2d45f1e622fe3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

From the documentation:

# SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME ZONE 'MST';
timezone
---------------------
2001-02-16 18:38:40

MST is UTC-07, so i would expect that i can replace MST with UTC-07, but:

# SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME
ZONE 'UTC-07';
timezone
---------------------
2001-02-17 08:38:40

The time returned is at UTC+07....

Lets try at UTC+07 instead:

# SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME
ZONE 'UTC+07';
timezone
---------------------
2001-02-16 18:38:40

I this a bug or a feature, and if it is a feature, whats the rational behind it?

Regards
Andreas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2007-05-08 15:35:33 Re: Slow query and indexes...
Previous Message Jim Nasby 2007-05-08 15:31:36 Re: Continuous Archiving for Multiple Warm Standby Servers