BUG #13683: Problem with recursive call plpython function

Поиск
Список
Период
Сортировка
От a.n.d@inbox.ru
Тема BUG #13683: Problem with recursive call plpython function
Дата
Msg-id 20151015135804.3019.31908@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13683
Logged by:          Andrey Chernyakov
Email address:      a.n.d@inbox.ru
PostgreSQL version: 9.4.1
Operating system:   RHEL 6.3
Description:

Exception "could not compile PL/Python function" on "create or replace
function ... language plpythonu" after recursive call plpython function.

Example:
[andrey@devbase ~]$ psql
psql (9.4.1)
Type "help" for help.

postgres=# create or replace function a(i integer) returns integer as
postgres-# $$
postgres$# if i > 42:
postgres$#     return i
postgres$# return plpy.execute("select a(%s)" % (i+1))[0]['a']
postgres$# $$ language plpythonu;
CREATE FUNCTION
postgres=#
postgres=# select a(0);
 a
----
 43
(1 row)

postgres=# create or replace function b() returns void as
postgres-# $$
postgres$# pass
postgres$# $$ language plpythonu;
ERROR:  could not compile PL/Python function "b"
DETAIL:  KeyError: 'i'

I am using plpython with python2.7

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

Предыдущее
От: boyko yordanov
Дата:
Сообщение: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function
Следующее
От: boyko yordanov
Дата:
Сообщение: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function