plpython and nrows()

Поиск
Список
Период
Сортировка
От Joseph Barillari
Тема plpython and nrows()
Дата
Msg-id m3sn5k9wp3.fsf@washer.barillari.org
обсуждение исходный текст
Список pgsql-general
The archives indicate that someone asked this question back in
November, but there's no record of a reply. Here goes:

I'm writing a function in plpython, and have been unable to get the
nrows() call to work. For instance, running the function:

CREATE OR REPLACE FUNCTION py_test()
    RETURNS INTEGER
    AS '
result = plpy.execute("""SELECT * FROM events;""")
rows = result.nrows()
return 0
'
LANGUAGE 'plpython';

results in the following:

cal=> select py_test();
ERROR:  plpython: Call of function `__plpython_procedure_py_test_67236' failed.
exceptions.SystemError: error return without exception set

I know that the nrows() call is responsible for the error (removing
the call eliminates the error), but am at a loss to determine how to
fix it. The testsuite doesn't seem to test nrows() (or so I grepped),
which led me to believe (perhaps mistakenly) that the implementation
might be broken. Any suggestions as to what to try would be
appreciated.

Regards,

--Joe
Вложения

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

Предыдущее
От: Gregory Seidman
Дата:
Сообщение: Re: odd psql behaviour on OSX
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Equivalent of FULLTEXT in mySQL