Re: strange TIME behaviour

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: strange TIME behaviour
Дата
Msg-id 20070915135312.GA17424@svana.org
обсуждение исходный текст
Ответ на Re: strange TIME behaviour  (rihad <rihad@mail.ru>)
Ответы Re: strange TIME behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: rihad
Дата:
Сообщение: Re: strange TIME behaviour
Следующее
От: rihad
Дата:
Сообщение: Re: strange TIME behaviour