Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

Поиск
Список
Период
Сортировка
От Jeremy Schneider
Тема Re: Returning timestamp with timezone at specified timezone irrespective of client timezone
Дата
Msg-id c870506a-bbae-fa72-c0d5-2f150964a5f8@ardentperf.com
обсуждение исходный текст
Ответ на Re: Returning timestamp with timezone at specified timezone irrespective of client timezone  (Jeremy Schneider <schneider@ardentperf.com>)
Список pgsql-general
On 9/27/20 20:13, Jeremy Schneider wrote:
> create or replace function to_char(
>    v_tstz timestamp with time zone
>   ,v_format text
>   ,v_tz text
> ) returns text language plpgsql
> immutable parallel safe
> as $$
> begin
>   perform set_config('timezone',v_tz,true);
>   return to_char(v_tstz,v_format);
> end;
> $$
> ;


Just occurred to me, I don't know if this is actually parallel safe. I'm
not sure how transaction-level session configuration is handled inside
parallel workers. Might be best to leave off the "parallel safe" flag
from the function for now.

-J

-- 
http://about.me/jeremy_schneider



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

Предыдущее
От: Jeremy Schneider
Дата:
Сообщение: Re: Returning timestamp with timezone at specified timezone irrespective of client timezone
Следующее
От: Paul Förster
Дата:
Сообщение: Re: pg_upgrade Python version issue on openSUSE