Timestamp with time zone

Поиск
Список
Период
Сортировка
От Xavier Robin
Тема Timestamp with time zone
Дата
Msg-id 4C2B42C7.3010403@bluewin.ch
обсуждение исходный текст
Список pgsql-novice
Hello,

I'm running a Debian Lenny box with PostgreSQL 8.4.4 from the backports.
I have a question regarding timestamps with time zone. I can't get time
zones inserted into my timestamp with time zone columns. For example:

> CREATE TABLE testcase(
>     created TIMESTAMP WITH TIME ZONE
> );
> INSERT INTO testcase VALUES (TIMESTAMP WITH TIME ZONE '2005-01-01 00:00+01');
> SELECT created, EXTRACT(TIMEZONE FROM created) FROM testcase;
>         created         | date_part
> ------------------------+-----------
>  2004-12-31 23:00:00+00 |         0
> (1 ligne)

Or from the docs:

> SELECT TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02';
>       timestamptz
> ------------------------
>  2004-10-19 08:23:54+00

In both examples, the timezone is lost. I read that

> To ensure that a literal is treated as timestamp with time zone, give it the correct explicit type

but how can I do that in pactice?

Thanks,
Xavier


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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: null vs empty string
Следующее
От: Xavier Robin
Дата:
Сообщение: Timestamp with time zone