Improve plpgsql's RAISE command. It is now possible to attach DETAIL and
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 13 May 2008 22:10:30 +0000 (22:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 13 May 2008 22:10:30 +0000 (22:10 +0000)
commita793798eec53cdd8a57a97333a7611634e4996d0
tree581542cdbad9c1496a634a826fa42b3d097f1f51
parent856c3f306bbf6fac25c2b8a0642509e6518ccb07
Improve plpgsql's RAISE command.  It is now possible to attach DETAIL and
HINT fields to a user-thrown error message, and to specify the SQLSTATE
error code to use.  The syntax has also been tweaked so that the
Oracle-compatible case "RAISE exception_name" works (though you won't get a
very nice error message if you just write that much).  Lastly, support
the Oracle-compatible syntax "RAISE" with no parameters to re-throw
the current error from within an EXCEPTION block.

In passing, allow the syntax SQLSTATE 'nnnnn' within EXCEPTION lists,
so that there is a way to trap errors with custom SQLSTATE codes.

Pavel Stehule and Tom Lane
doc/src/sgml/plpgsql.sgml
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/scan.l
src/test/regress/expected/plpgsql.out
src/test/regress/sql/plpgsql.sql