pgsql: Improve plpgsql's RAISE command.

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve plpgsql's RAISE command.
Date: 2008-05-13 22:10:30
Message-ID: 20080513221030.511E57559E9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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

Modified Files:
--------------
pgsql/doc/src/sgml:
plpgsql.sgml (r1.128 -> r1.129)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/plpgsql.sgml?r1=1.128&r2=1.129)
pgsql/src/pl/plpgsql/src:
gram.y (r1.111 -> r1.112)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/gram.y?r1=1.111&r2=1.112)
pl_comp.c (r1.125 -> r1.126)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_comp.c?r1=1.125&r2=1.126)
pl_exec.c (r1.213 -> r1.214)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c?r1=1.213&r2=1.214)
pl_funcs.c (r1.70 -> r1.71)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_funcs.c?r1=1.70&r2=1.71)
plpgsql.h (r1.98 -> r1.99)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h?r1=1.98&r2=1.99)
scan.l (r1.62 -> r1.63)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/scan.l?r1=1.62&r2=1.63)
pgsql/src/test/regress/expected:
plpgsql.out (r1.62 -> r1.63)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/plpgsql.out?r1=1.62&r2=1.63)
pgsql/src/test/regress/sql:
plpgsql.sql (r1.52 -> r1.53)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/plpgsql.sql?r1=1.52&r2=1.53)

Browse pgsql-committers by date

  From Date Subject
Next Message User Eggyknap 2008-05-14 03:23:42 pllolcode - pllolcode: Return strings properly, thanks to Tom Lane
Previous Message Magnus Hagander 2008-05-13 20:54:02 pgsql: Don't try to close negative file descriptors, since this can