Undocumented optionality of handler_statements - Mailing list pgsql-docs

From PG Doc comments form
Subject Undocumented optionality of handler_statements
Date
Msg-id 172165655256.710.2097726158572647813@wrigleys.postgresql.org
Whole thread Raw
Responses Re: Undocumented optionality of handler_statements
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/plpgsql-control-structures.html
Description:

In
https://www.postgresql.org/docs/16/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
handler_statements are documented as optional.

However, the following example shows that handler_statements can be omitted.


drop table if exists t;
create table t (id integer not null primary key);
do $$
begin
    insert into t (id) values (1), (1);
exception when unique_violation then
    -- ignore without calling null statement
end
$$;

I stumbled over it when running the example documented in
https://www.postgresql.org/docs/current/plpgsql-trigger.html#PLPGSQL-TRIGGER-SUMMARY-EXAMPLE
- it also contains an exception handler without handler statements.

pgsql-docs by date:

Previous
From: jian he
Date:
Subject: Re: Undocumented := alternative in using option of raise statement
Next
From: Philipp Salvisberg
Date:
Subject: Re: Undocumented := alternative in using option of raise statement