Re: Calendar vs. Timestamp

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Calendar vs. Timestamp
Дата
Msg-id Pine.BSO.4.63.0604111814090.31152@leary2.csoft.net
обсуждение исходный текст
Ответ на Re: Calendar vs. Timestamp  ("Wei Wei" <wei725@lycos.com>)
Список pgsql-jdbc

On Tue, 11 Apr 2006, Wei Wei wrote:

> I would like to clarify one observation. The timestamp seems only take
> the date section data of a calendar object regardless the value of the
> time zone. If so, a calendar object with a specified time zone would not
> make any difference in comparsion to a calendar object with the default
> time zone. Or, the default time zone is always used in PG.
>

I think the confusion arises from the fact that the server always stores
timestamps in utc and always returns them based upon the current setting
of the TimeZone configuration parameter.

CREATE TABLE tstest(a timestamptz);
INSERT INTO tstest VALUES ('2006-04-11 16:15:28-07');
INSERT INTO tstest VALUES ('2006-04-11 16:15:28-08');
SET TimeZone = 'America/Los_Angeles';
INSERT INTO tstest VALUES ('2006-04-11 16:15:28');
SELECT * FROM tstest;
SET TimeZone = 'America/New_York';
INSERT INTO tstest VALUES ('2006-04-11 16:15:28');
SELECT * FROM tstest;

Kris Jurka


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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: FastPath blocked when ERROR is thrown
Следующее
От: "Wei Wei"
Дата:
Сообщение: Re: Calendar vs. Timestamp