42.6.8.1. Obtaining Information About An Error

Started by PG Bug reporting formover 5 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

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

42.6.8.1. Obtaining Information About An Error

This example omits raise notice code:

DECLARE
text_var1 text;
text_var2 text;
text_var3 text;
BEGIN
-- some processing which might cause an exception
...
EXCEPTION WHEN OTHERS THEN
GET STACKED DIAGNOSTICS text_var1 = MESSAGE_TEXT,
text_var2 = PG_EXCEPTION_DETAIL,
text_var3 = PG_EXCEPTION_HINT;
END;

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: 42.6.8.1. Obtaining Information About An Error

On Wed, Oct 7, 2020 at 12:57 PM PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

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

42.6.8.1. Obtaining Information About An Error

This example omits raise notice code:

Yes, it does. I do not find the example any less useful for the lack.

How one chooses to use the error information is not the point of the
example, showing how to pull the data out of the error context is.

David J.