From fcc7f8289c078ac0e7174ce16a030c11a163a1db Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Sun, 24 Sep 2023 16:03:59 -0500 Subject: [PATCH v3 04/11] Describe how to raise an exception in the exception section Most of this section is about managing program control flow, but the section does not mention how to raise an exception anywhere. This new sentence says how, and provides a link into the section on raising exceptions for those who want to know more. Line break after end of sentence to simplify reading of future patches. --- doc/src/sgml/plpgsql.sgml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 127dd1b337..54402752b2 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -2765,8 +2765,11 @@ NOTICE: row = {10,11,12} By default, any error occurring in a PL/pgSQL - function aborts execution of the function and the - surrounding transaction. You can trap errors and recover + function aborts execution of the function and the surrounding + transaction. + You can raise an exception and throw an error + with RAISE EXCEPTION .... + You can trap errors and recover from them by using a BEGIN block with an EXCEPTION clause. The syntax is an extension of the normal syntax for a BEGIN block: -- 2.30.2