From f1547ccab10a41ac3d58aa49c540d5bb845507a1 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Sun, 24 Sep 2023 16:03:59 -0500 Subject: [PATCH v2 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 646d0305eb..3cecf7bbd9 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