generate_series for timestamptz and time zone problem

Поиск
Список
Период
Сортировка
От Przemysław Sztoch
Тема generate_series for timestamptz and time zone problem
Дата
Msg-id 01a84551-48dd-1359-bf7e-f6b0203a6bd0@sztoch.pl
обсуждение исходный текст
Ответы Re: generate_series for timestamptz and time zone problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval )
produces results depending on the timezone value set:

SET timezone = 'UTC';
SELECT ts, ts AT TIME ZONE 'UTC'
FROM generate_series('2022-03-26 00:00:00+01'::timestamptz, '2022-03-30 00:00:00+01'::timestamptz, '1 day') AS ts
;

SET timezone = 'Europe/Warsaw';
SELECT ts, ts AT TIME ZONE 'UTC'
FROM generate_series('2022-03-26 00:00:00+01'::timestamptz, '2022-03-30 00:00:00+01'::timestamptz, '1 day') AS ts
;

Sometimes this is a very big problem.

The fourth argument with the time zone will be very useful:
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval  [, zone text] )

The situation is similar with the function timestamptz_pl_interval. The third parameter for specifying the zone would be very useful.

--
Przemysław Sztoch | Mobile +48 509 99 00 66

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Prevent writes on large objects in read-only transactions
Следующее
От: Robert Haas
Дата:
Сообщение: Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485)