"Voillequin, Jean-Marc" <Jean-Marc.Voillequin@moodys.com> writes:
> For instance, is the following plpython3u function parallel safe?
> create or replace function f1(key text, val_default in text default null) returns text as $$
> return GD.get(key.lower(),val_default)
> $$ language plpython3u;
No. There's no mechanism for sharing Python interpreter state across
processes.
> => Is it a transaction state change?
Throwing an error is always OK (we could hardly decree otherwise).
> execute format('select (''%s''::date + interval ''%s'')::date',d,concat(n,' day')) into ret;
> => Is this execute statement be considered as a cursor?
No, it's just a weird way of spelling a variable assignment.
regards, tom lane