Re: Call postgres PL/Python stored function from another PL/Python block.

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Call postgres PL/Python stored function from another PL/Python block.
Дата
Msg-id 569682C2.9000202@BlueTreble.com
обсуждение исходный текст
Ответ на Call postgres PL/Python stored function from another PL/Python block.  (lodopidolo <dir.postgresql@orencio.org>)
Список pgsql-general
On 1/13/16 9:47 AM, lodopidolo wrote:
> Hello. It is possible to call al PL/Python stored function natively from
> another PL/Python function?

Stackoverflow is stupid and won't let me post there, but here's what you
want:

There is no special capability to call other plpython functions. You
need to call them as you would any other Postgres function, ie:

     do $$
     begin
     ...
     rv = plpy.execute("SELECT f1()")
     t = rv[1]["f1]
     ...
     end;
     $$ language 'plpython3u';

See
http://www.postgresql.org/docs/9.5/static/plpython-database.html#AEN65599 for
more information.

--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Blocked updates and background writer performance
Следующее
От: David Grelaud
Дата:
Сообщение: Re: Why PG uses nested-loop join when no indexes are available?