Re: Timestamp to time_t

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>, "Scott Mohekey" <scott(dot)mohekey(at)telogis(dot)com>
Subject: Re: Timestamp to time_t
Date: 2009-09-14 17:29:58
Message-ID: 4AAE3746020000250002AF0C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Scott Mohekey <scott(dot)mohekey(at)telogis(dot)com> wrote:

> What is the relationship between Timestamp and TimestampTz?

TIMESTAMP WITHOUT TIME ZONE does not identify a moment in time without
first associating it with a time zone. When Daylight Saving Time
ends, the same TIMESTAMP WITHOUT TIME ZONE values will recur, without
any way to distinguish them from those from the previous hour.

The only use case I have been able to think of, personally, for
TIMESTAMP WITHOUT TIME ZONE is a release date for, say a Harry Potter
book or World of Warcraft expansion set, where as the given moment
arrives in each time zone, stores in that time zone can begin to sell
the given work.

I suspect there's probably one or two other valid uses, but most uses
are just mistakes, waiting to be exposed. For almost every reasonable
use, the right data type is TIMESTAMP WITH TIME ZONE.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message decibel 2009-09-14 17:33:49 Re: RfD: more powerful "any" types
Previous Message Josh Berkus 2009-09-14 17:14:40 Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.