On 1/26/15 9:46 AM, Pavel Stehule wrote:
>
> The design I thought had been agreed on was to add some new option to
> plpgsql's RAISE command which would cause suppression of all CONTEXT lines
> not just the most closely nested one. You could argue about whether the
> behavior needs to be 100% backwards compatible or not --- if so, perhaps
> it could be a three-way option all, none, or one line, defaulting to the
> last for backwards compatibility.
>
>
> I see a problem what should be default behave. When I raise NOTICE, then I don't need (don't would) to see CONTEXT
lines,When I raise EXCEPTION, then I usually would to see CONTEXT lines.
FWIW, that's the case I almost always run into: I turn on some debugging which means I know where the RAISE is coming
from,but now I'm flooded with CONTEXT lines. You could do that with an option to RAISE, but that seems like a lot of
extracoding work for little gain. Perhaps it'd be worth creating client_min_context and log_min_context GUCs...
Another option that I think would work well is that you only provide context for the first call within a "block" of
code.For plpgsql that would be a function, but maybe it'd be better to just do this per-subtransaction.
I do agree that this needs to work across the board, not just for plpgsql.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com