Re: parallel safe on user defined functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: parallel safe on user defined functions
Дата
Msg-id 1574257.1606925735@sss.pgh.pa.us
обсуждение исходный текст
Ответ на parallel safe on user defined functions  ("Voillequin, Jean-Marc" <Jean-Marc.Voillequin@moodys.com>)
Список pgsql-sql
"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



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

Предыдущее
От: "Voillequin, Jean-Marc"
Дата:
Сообщение: parallel safe on user defined functions
Следующее
От: Yambu
Дата:
Сообщение: calling function