]> granicus.if.org Git - postgresql/commit
Get rid of the global variable holding the error state
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 22 Jan 2011 20:08:51 +0000 (22:08 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 22 Jan 2011 20:12:32 +0000 (22:12 +0200)
commit116ce2f4d01b929cc7c3bd0f7e6bca631f83da50
tree614258e21d3ee382aea293702109ea0fce4db37b
parent37eb2cd4ad4c3323f1c7ed1c893c9d645fbaeb1a
Get rid of the global variable holding the error state

Global error handling led to confusion and was hard to manage.  With
this change, errors from PostgreSQL are immediately reported to Python
as exceptions.  This requires setting a Python exception after
reporting the caught PostgreSQL error as a warning, because PLy_elog
destroys the Python exception state.

Ideally, all places where PostgreSQL errors need to be reported back
to Python should be wrapped in subtransactions, to make going back to
Python from a longjmp safe.  This will be handled in a separate patch.

Jan UrbaƄski
src/pl/plpython/expected/plpython_error.out
src/pl/plpython/expected/plpython_test.out
src/pl/plpython/plpython.c