Re: extract(timezone_hour) funny business

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: extract(timezone_hour) funny business
Дата
Msg-id 3BC53EA2.3290C14A@fourpalms.org
обсуждение исходный текст
Ответ на extract(timezone_hour) funny business  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
> Plus or minus?

Is there a standard for this? We are printing date/time using Posix
conventions, which are opposite from the SQL conventions for setting
time zone (which we don't yet support, since it is fundamentally useless
;) I apparently implemented one, and you expect the other.

> peter=# select extract(timezone_hour from timestamp '2001-10-10 01:04:54.965162+03');
> -----------
>         -2
> Big problem.

Not really. The timestamp you have specified is read in and internalized
as a gmt value, then is rewritten using your current time zone settings.
afaict the time zone on an input value should not persist with the value
itself, so the info does not carry far enough forward to be used for an
output routine.

Note that I did not implement "time with time zone" this way, but rather
used a "persistant time zone". I *think* that this should be taken out,
but further discussion is welcome. The reference books are distressingly
unclear or obviously incorrect on this topic, presumably in the
interests of remaining lucid.
                    - Thomas


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

Предыдущее
От: "Balaji Venkatesan"
Дата:
Сообщение: Suitable Driver ?
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: EXTRACT broken