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