From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: Confused coding in PLy_traceback()
Date: Sun, 01 Jun 2025 15:05:37 -0400
Message-ID: <3395263.1748804737@sss.pgh.pa.us> (raw)
In-Reply-To: <2954090.1748723636@sss.pgh.pa.us>
References: <2954090.1748723636@sss.pgh.pa.us>
I wrote:
> So I propose the attached. For ease of review, I've not re-indented
> the code that needs to move inside PG_TRY blocks. Also, I dropped the
> logic about pfree'ing the string buffers in PLy_elog_impl's PG_FINALLY
> block: that doesn't seem necessary, and continuing to do it would
> require making those things volatile which is notationally messy.
Pushed. After sleeping on it I decided that removing the pfree's
would be a poor tradeoff, as it's not clear how long those allocations
might survive otherwise. The extra "volatile" markers for "xmsg"
and "tbmsg" aren't that big a deal. Trying to mark "emsg" as volatile
would be problematic because none of the StringInfo routines are set
up to allow that, but it shouldn't be a problem because that struct
will surely be on the stack.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: Confused coding in PLy_traceback()
In-Reply-To: <3395263.1748804737@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox