pgsql: Expose object name error fields in PL/pgSQL.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Expose object name error fields in PL/pgSQL.
Date: 2013-07-03 11:40:53
Message-ID: E1UuLQb-0003pD-Gp@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Expose object name error fields in PL/pgSQL.

Specifically, permit attaching them to the error in RAISE and retrieving
them from a caught error in GET STACKED DIAGNOSTICS. RAISE enforces
nothing about the content of the fields; for its purposes, they are just
additional string fields. Consequently, clarify in the protocol and
libpq documentation that the usual relationships between error fields,
like a schema name appearing wherever a table name appears, are not
universal. This freedom has other applications; consider a FDW
propagating an error from an RDBMS having no schema support.

Back-patch to 9.3, where core support for the error fields was
introduced. This prevents the confusion of having a release where libpq
exposes the fields and PL/pgSQL does not.

Pavel Stehule, lexical revisions by Noah Misch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7cd9b1371d8b18d063dc38bc4fa7b30bd92c07a3

Modified Files
--------------
doc/src/sgml/libpq.sgml | 39 +++++++------
doc/src/sgml/plpgsql.sgml | 36 ++++++++++++
doc/src/sgml/protocol.sgml | 27 +++++----
src/pl/plpgsql/src/pl_exec.c | 98 ++++++++++++++++++++++++++-------
src/pl/plpgsql/src/pl_funcs.c | 25 +++++++++
src/pl/plpgsql/src/pl_gram.y | 55 ++++++++++++++++++
src/pl/plpgsql/src/pl_scanner.c | 10 ++++
src/pl/plpgsql/src/plpgsql.h | 14 ++++-
src/test/regress/expected/plpgsql.out | 34 ++++++++++++
src/test/regress/sql/plpgsql.sql | 32 +++++++++++
10 files changed, 321 insertions(+), 49 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-07-03 14:50:55 pgsql: Additional regression tests for CREATE OPERATOR.
Previous Message Peter Eisentraut 2013-07-03 00:35:10 pgsql: doc: Remove i18ngurus.com link