How to track error messages come from plpy.execute?

Поиск
Список
Период
Сортировка
От guti deng
Тема How to track error messages come from plpy.execute?
Дата
Msg-id AANLkTimzu_LYu3FNt+J-Yad2BWqLmAkxB9JGtSByFkn1@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi there,

The problem is, i call a stored function with 'plpy.execute()', and there may be error thrown out from the callee function. I want to get the error message.
I try to put plpy.execute into  a python try-except, but i doesn't work.
Anyone has an idea?


Explanation about the context:

create function func_throw_error() returns integer as
$BODY$
declare
begin
    select some obvioursly wrong SQL;
end;
$BODY$
language 'plpgsql';

create function func_caller returns integer as
$BODY$
try:
    plpy.execute('select func_throw_error()')
except Exception, e:
    print e
return 0
$BODY$
language 'plpythonu';

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

Предыдущее
От: "Brent Wood"
Дата:
Сообщение: Re: Selecting top N percent of records.
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: installing from source in Windows