Re: strange TIME behaviour

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: rihad <rihad(at)mail(dot)ru>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: strange TIME behaviour
Date: 2007-09-15 13:53:12
Message-ID: 20070915135312.GA17424@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rihad 2007-09-15 13:53:26 Re: strange TIME behaviour
Previous Message rihad 2007-09-15 13:40:38 Re: strange TIME behaviour