Search Postgresql Archives

How to track error messages come from plpy.execute?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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';

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux