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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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:
plpgsql.sgml (r1.128 -> r1.129)
gram.y (r1.111 -> r1.112)
pl_comp.c (r1.125 -> r1.126)
pl_exec.c (r1.213 -> r1.214)
pl_funcs.c (r1.70 -> r1.71)
plpgsql.h (r1.98 -> r1.99)
scan.l (r1.62 -> r1.63)
plpgsql.out (r1.62 -> r1.63)
plpgsql.sql (r1.52 -> r1.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