Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Date: 2013-07-25 04:05:45
Message-ID: CAOuzzgoFsPR+2J6PMVMDEpV0NA5gcvNAjhaFttD40htUCGPjBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wednesday, July 24, 2013, Stephen Frost wrote:

> Unfortunately, I don't have the code in front of me at the moment, but I
> was pretty sure FlushErrorState cleans up the intermediate information set
> up during an individual error call and doesn't completely clear the stack
> info (tho I can't think of what, if anything, does..) or multiple "raise
> notices" wouldn't each contain the stack info in their output..
>
> I'll certainly look through this again and dream up some additional test
> cases for it, in the morning.
>

Couldn't help if- reading code on a phone isn't ideal, but that's a
different discussion.

You're right- resetting the stack depth doesn't make any sense here, which
FlushErrorState does. I think clearing the memory context should be
alright but that's a different story. Curious that the raise notice in the
regression test didn't blow up, which is part of why I thought it was fine,
but a subsequent call to raise notice in the same function would be a good
test (along with another call to this function..) and I think wouldn't
produce a stack trace here, which would be quite wrong.

Will address once I'm back I front of something I can actually write code
on.

Thanks,

Stephen

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2013-07-25 04:39:49 Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Previous Message Stephen Frost 2013-07-25 03:36:08 Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-07-25 04:39:49 Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Previous Message Stephen Frost 2013-07-25 03:36:08 Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL