pgsql: Get rid of the global variable holding the error state - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Get rid of the global variable holding the error state
Date
Msg-id E1Pgjr2-0005Fw-MZ@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Get rid of the global variable holding the error state  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: More pg_test_fsync fixups.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Get rid of the global variable holding the error state