Re: TIMESTAMP WITHOUT TIME ZONE

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: TIMESTAMP WITHOUT TIME ZONE
Дата
Msg-id
20061215223322.GZ14237@alvh.no-ip.org
Ответ на
Список
Дерево обсуждения
TIMESTAMP WITHOUT TIME ZONE "Randy Shelley" <randy.shelley@gmail.com>
Re: TIMESTAMP WITHOUT TIME ZONE Tom Lane <tgl@sss.pgh.pa.us>
Re: TIMESTAMP WITHOUT TIME ZONE Richard Troy <rtroy@ScienceTools.com>
Re: TIMESTAMP WITHOUT TIME ZONE Martijn van Oosterhout <kleptog@svana.org>
Re: TIMESTAMP WITHOUT TIME ZONE Tom Lane <tgl@sss.pgh.pa.us>
Re: TIMESTAMP WITHOUT TIME ZONE Richard Huxton <dev@archonet.com>
Re: TIMESTAMP WITHOUT TIME ZONE Richard Troy <rtroy@ScienceTools.com>
Re: TIMESTAMP WITHOUT TIME ZONE Tom Lane <tgl@sss.pgh.pa.us>
Re: TIMESTAMP WITHOUT TIME ZONE Richard Troy <rtroy@ScienceTools.com>
Re: TIMESTAMP WITHOUT TIME ZONE Alvaro Herrera <alvherre@commandprompt.com>
Re: TIMESTAMP WITHOUT TIME ZONE Tom Lane <tgl@sss.pgh.pa.us>
Re: TIMESTAMP WITHOUT TIME ZONE "Brandon Aiken" <BAiken@winemantech.com>
Richard Troy wrote:

> I'd appreciate a clean yes/no;  From a Java application, throught PG in
> both directions, the same timestamp comes back that was handed to the JDBC
> driver so long as it's stored in a "timestamp without time zone"
> attribute, nomatter neither where on earth the insert/update originates,
> nor where the select originates? Same bits, yes? Otherwise, "Houston,
> we've got a problem."

If you pass a timestamp without time zone, the given timestamp will be
given back to you on request, no changes applied, whatever the timezone
either the inserter or the extracter are on.

If you pass a timestamp with time zone, the time will be rotated to UTC
on insert depending on the inserter's timezone (thus it's stored as
UTC), and will be rotated "back" to the extracter's timezone when you
extract it.  Note that both timezones may be different, so the numbers
you get may be different than the numbers you put in, but they will
signal exactly the same instant in time (in the appropriate time zone).

If you want to know what time zone the inserter used, you would store
that in a separate column.
В списке pgsql-general по дате отправления
От: Richard Troy
Дата:
От: Tom Lane
Дата:
FAQ