Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice... - Mailing list pgsql-general

From Greg Stark
Subject Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date
Msg-id 87k7fx4m61.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > The documentation I've read makes it sound like these two data types are
> > equivalent in every way except for the default timezone assumed interpretation
> > when converting to and from textual representations. Is that not true?
>
> I wouldn't think so.  For example, you get dissimilar results near
> daylight-savings-time boundaries:

Well how is that different from just saying the timestamp is always in GMT?

The confusing part is what happens when you cast from a timestamptz to a
timestamp. It doesn't seem to adjust for the current time zone of the
timestamptz, it just drops it.

> timestamp just stores the nominal HH:MM:SS value you give it, with no sense
> that it knows what time that really is, and no attempt to correct for
> different local timezones nor for daylight-savings changes.

Ok, I guess I understand now the difference between timestamp and timestamptz,
I just don't see what use a timestamp that doesn't represent a particular time
would ever be. It seems to serve only as a gotcha for unwary programmers who
take the default.

--
greg

pgsql-general by date:

Previous
From: "Mike Mascari"
Date:
Subject: Re: Index not used with IS NULL
Next
From: "Ben-Nes Michael"
Date:
Subject: instaling pg to new directory when upgrading