Re: strange TIME behaviour - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: strange TIME behaviour
Date
Msg-id 20070915135312.GA17424@svana.org
Whole thread Raw
In response to Re: strange TIME behaviour  (rihad <rihad@mail.ru>)
Responses Re: strange TIME behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sat, Sep 15, 2007 at 06:40:38PM +0500, rihad wrote:
> PostgreSQL seems to default to "time without time zone" when declaring
> columns in the table schema. Since all my times and timestamps are in
> local time zone, and I'm *only* dealing with local times, should I be
> using "time with time zone" instead? When would it make a difference?
> Only when comparing/subtracting? Is "with time zone" not the default
> because it's slower?

Historical I beleive. Postgres has four types: timestamp, timestamptz,
time and timetz. Then SQL decreed that TIMESTAMP means WITH TIME ZONE,
ie timestamptz. So now you get the odd situation where:

timestamp   == timestamp with time zone == timestamptz
"timestamp" == timestamp without time zone == timestamp
time        == time without timezone

Unfortunatly, the backward compatability issues to fixing this are
tricky.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: rihad
Date:
Subject: Re: strange TIME behaviour
Next
From: rihad
Date:
Subject: Re: strange TIME behaviour