Re: Postgres and timezones

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Postgres and timezones
Дата
Msg-id 569FDDD0.7020106@2ndquadrant.fr
обсуждение исходный текст
Ответ на Re: Postgres and timezones  (Steve Rogerson <steve.pg@yewtc.demon.co.uk>)
Ответы Re: Postgres and timezones  (Steve Rogerson <steve.pg@yewtc.demon.co.uk>)
Список pgsql-general
On 01/20/2016 04:24 PM, Steve Rogerson wrote:
>> Postgres doesn't store original TZ. It does recalculation to local TZ. If you
>> need original TZ, you have to store it separetely.
>>
>
> I know and that's what I'm trying to deal with. Given I know the origin TZ  -
> as in Europe/Lisbon I'm trying to determine the short name so I can store it.

I would recommend against storing the abbreviation.  The abbreviations
are not globally unique and don't follow daylight savings.  If you want
to store the original time zone, I would use the full name.

Something like this might be relative to your interests:

    INSERT INTO tbl (ts, tz)
    VALUES ('2016-01-20 00:00', current_setting('TimeZone'));

This will do the right thing regardless of where the client is (unless
it's set to "localtime" and then it's useless).
--
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: CoC [Final]
Следующее
От: David Grelaud
Дата:
Сообщение: Re: Why PG uses nested-loop join when no indexes are available?