Re: Call stacks and RAISE INFO - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Call stacks and RAISE INFO
Date
Msg-id CAFj8pRA9=GEfUXPsq2P8iLKSzaGk=Tq25AdNUBGkTD13y2sOWA@mail.gmail.com
Whole thread Raw
In response to Re: Call stacks and RAISE INFO  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Call stacks and RAISE INFO  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello

2011/10/15 Josh Berkus <josh@agliodbs.com>:
>
>> Now that we have syntax for adding miscellaneous options to RAISE
>> statements, what I suggest we consider is a RAISE option that suppresses
>> all context lines for the message, perhaps
>>
>> RAISE NOTICE 'fee, fi, fo, fum' USING context = false;
>
> Yeah, that would do it.  Pavel?  ;-)
>

I have no problem with this.  A context can be false for info and true
for other in default. Please, use a different identifier than
"context", that can be use for reading context in future - maybe
"attach_context" or some similar.

Just note, when we are in this topis. I got a experience so debugging
functions that contains a pattern

BEGIN .. do some .. that can raise exception ...
EXCEPT WHEN OTHERS .. .. do some else RAISE ... ;
END IF

is little bit difficult, because we lost a context information about
original exception

Regards

Pavel

> --
> Josh Berkus
> PostgreSQL Experts Inc.
> http://pgexperts.com
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


pgsql-hackers by date:

Previous
From: Hitoshi Harada
Date:
Subject: Re: Underspecified window queries in regression tests
Next
From: Tom Lane
Date:
Subject: Re: [REVIEW] Patch for cursor calling with named parameters