Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date: 2003-02-18 15:56:54
Message-ID: 87k7fx4m61.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Greg Stark <gsstark(at)mit(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Stump 2003-02-18 16:19:30 Re: nodeRead: did not find '}' at end of plan node
Previous Message Mike Mascari 2003-02-18 15:55:50 Re: Index not used with IS NULL