Re: AT TIME ZONE: "convert"?

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: AT TIME ZONE: "convert"?
Date: 2004-11-01 14:01:41
Message-ID: 418641C5.7070408@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout wrote:
> You misunderstand the TIMESTAMP WITH TIMEZONE type, it doesn't store
> the timezone you gave it, it's just a point in time. Saying AT TIMEZONE
> just converts it to a TIMESTAMP WITHOUT TIMEZONE with the local time it
> was in the timezone you gave it. So you are complaring different
> things. See:

You're right, I forgot that AT TIME ZONE on timestamptz value currently
returns a timestamp, not timestamptz.

I do realize that currently timestamptz doesn't store the timezone
offset/timezone name (thus timestamp and timestamptz both require the
same amount of storage, 8 bytes). But I believe this probably won't be
so in the future. So the question remains, does AT TIME ZONE already do
what it's supposed to do (according to SQL standard, that is) or will
the behaviour be changed in the future? Will AT TIME ZONE returns
timestamptz in the future instead of timestamp, and will the "converted"
timestamp value be the same if compared with '=' operator?

--
dave

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2004-11-01 14:59:46 Re: logging queries and time used
Previous Message Martijn van Oosterhout 2004-11-01 13:10:25 Re: AT TIME ZONE: "convert"?