pgsql: Allow a context to be passed in for error handling - Mailing list pgsql-committers

From Stephen Frost
Subject pgsql: Allow a context to be passed in for error handling
Date
Msg-id E1V4lCj-0005rZ-Gv@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Allow a context to be passed in for error handling

As pointed out by Tom Lane, we can allow other users of the error
handler callbacks to provide their own memory context by adding
the context to use to ErrorData and using that instead of explicitly
using ErrorContext.

This then allows GetErrorContextStack() to be called from inside
exception handlers, so modify plpgsql to take advantage of that and
add an associated regression test for it.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ddef1a39c6798ffae899acd08ff92329dd304085

Modified Files
--------------
src/backend/utils/error/elog.c        |  126 ++++++++++++++++-----------------
src/include/utils/elog.h              |    3 +
src/pl/plpgsql/src/pl_gram.y          |    4 +-
src/test/regress/expected/plpgsql.out |   98 +++++++++++++++++++++++++
src/test/regress/sql/plpgsql.sql      |   56 +++++++++++++++
5 files changed, 221 insertions(+), 66 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Fix mis-indented lines
Next
From: Stephen Frost
Date:
Subject: pgsql: Add locking around SSL_context usage in libpq