Re: AT TIME ZONE: "convert"? - Mailing list pgsql-general

From David Garamond
Subject Re: AT TIME ZONE: "convert"?
Date
Msg-id 418641C5.7070408@zara.6.isreserved.com
Whole thread Raw
In response to Re: AT TIME ZONE: "convert"?  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: AT TIME ZONE: "convert"?
List 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


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: AT TIME ZONE: "convert"?
Next
From: raptor
Date:
Subject: spreading the DB?