Re: skipping context for RAISE statements - maybe obsolete?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: skipping context for RAISE statements - maybe obsolete?
Date: 2012-12-11 19:34:32
Message-ID: CAFj8pRCsFah21ZY7nbxy4ujX9w-q662PPez=baYHPjoJei7=Mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/12/11 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> /* if we are doing RAISE, don't report its location */
>> if (estate->err_text == raise_skip_msg)
>> return;
>
>> It is some what we want?
>
> My recollection is that that special case was added because people
> complained about the "noise" from location lines otherwise: there are
> too many applications using RAISE to report user errors, for which a
> traceback would just be useless noise. I dug around in the archives a
> bit but couldn't find the original discussion. But I did find a fairly
> recent complaint that it's still too noisy (rather than not noisy
> enough):
> http://archives.postgresql.org/pgsql-hackers/2011-10/msg00838.php
>
> At the end of that thread we discussed adding a RAISE option to control
> the behavior, but nothing's been done about it.

I can understand to this idea - but it don't work yet, respective it
working only for one level of call. If you get exception from nested
call, then you get CONTEXT from custom exception too:

Some flag of RAISE statement can be solution, but I don't like it.
Probably you would to change behave for all RAISE statements in
function - not individually for one or second. And when you debug some
application, you probably invite any solution that ensure change
without necessity to modify function's source code. I know so GUC are
limited, but in this cases, it has a minimal impact to data - and it
can be ajusted on database, session, function level. A analogy is our
solution for SQL identifiers and plpgsql variables solving collisions
- it is best, and I newer heard about any issue.

Regards

Pavel Stehule

>
> regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-12-11 20:05:06 Re: PageIsAllVisible()'s trustworthiness in Hot Standby
Previous Message Andres Freund 2012-12-11 19:11:58 Re: [PATCH 02/14] Add support for a generic wal reading facility dubbed XLogReader