Re: with or without timezone?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joshua N Pritikin <jpritikin(at)pobox(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: with or without timezone?
Date: 2005-05-07 15:20:46
Message-ID: 2785.1115479246@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua N Pritikin <jpritikin(at)pobox(dot)com> writes:
> I am designing a new schema from scratch. Which type is more natural to
> work with, a timestamp with a timezone or without a timezone? I read
> the 7.4 documentation on timezones two or three times but I'm still not
> really sure. The fact that the default is without time zone suggests
> that without is more natural. But I have a vague preference for with
> time zone. Can someone push me in the right direction?

The default is compelled by the SQL spec; it's not what the developers
think is the most rational choice ;-)

If you are storing timestamps that represent absolute points in time,
I would definitely recommend using TIMESTAMP WITH TIME ZONE. That
will have the "correct" value if/when you look at the data from another
TimeZone setting.

I haven't seen all that many applications where TIMESTAMP WITHOUT
TIME ZONE was really the best choice; although if you want to do
date arithmetic without thinking about daylight-saving-transition
funnies, I suppose it has its uses. If you're not interested in
time-of-day at all, you should choose plain DATE.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2005-05-07 16:25:34 Re: Functions!
Previous Message Hrishikesh Deshmukh 2005-05-07 14:34:50 Functions!