Обсуждение: pgsql: Get rid of the global variable holding the error state

Поиск
Список
Период
Сортировка

pgsql: Get rid of the global variable holding the error state

От
Peter Eisentraut
Дата:
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

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=116ce2f4d01b929cc7c3bd0f7e6bca631f83da50

Modified Files
--------------
src/pl/plpython/expected/plpython_error.out |   15 ++-
src/pl/plpython/expected/plpython_test.out  |    2 +-
src/pl/plpython/plpython.c                  |  171 ++++++++++++++++-----------
3 files changed, 114 insertions(+), 74 deletions(-)


Re: pgsql: Get rid of the global variable holding the error state

От
Tom Lane
Дата:
Peter Eisentraut <peter_e@gmx.net> writes:
> Get rid of the global variable holding the error state

The buildfarm doesn't like this patch one bit.

            regards, tom lane