postgresql/src/pl
Neil Conway d46bc444ac Implement two new special variables in PL/PgSQL: SQLSTATE and SQLERRM.
These contain the SQLSTATE and error message of the current exception,
respectively. They are scope-local variables that are only defined
in exception handlers (so attempting to reference them outside an
exception handler is an error). Update the regression tests and the
documentation.

Also, do some minor related cleanup: export an unpack_sql_state()
function from the backend and use it to unpack a SQLSTATE into a
string, and add a free_var() function to pl_exec.c

Original patch from Pavel Stehule, review by Neil Conway.
2005-06-10 16:23:11 +00:00
..
plperl Here's a patch to do the following: 2005-06-05 03:16:42 +00:00
plpgsql Implement two new special variables in PL/PgSQL: SQLSTATE and SQLERRM. 2005-06-10 16:23:11 +00:00
plpython Fix PL makefiles to support running regression tests in VPATH builds. 2005-05-24 17:07:41 +00:00
tcl Fix PL makefiles to support running regression tests in VPATH builds. 2005-05-24 17:07:41 +00:00
Makefile Convert the existing regression test scripts for the various optional 2005-05-14 17:55:22 +00:00