pgsql: Improve plpgsql's RAISE command. - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Improve plpgsql's RAISE command.
Date
Msg-id 20080513221030.511E57559E9@cvs.postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: mha@postgresql.org (Magnus Hagander)
Date:
Subject: pgsql: Don't try to close negative file descriptors, since this can
Next
From: jbcooley@pgfoundry.org (User Jbcooley)
Date:
Subject: npgsql - Npgsql2: bug #1010372.