pgsql: Allow a context to be passed in for error handling

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Allow a context to be passed in for error handling
Дата
Msg-id E1V4lCj-0005rZ-Gv@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix mis-indented lines
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Add locking around SSL_context usage in libpq