From: Tom Lane <tgl@sss.pgh.pa.us>
To: 857348270@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17837: The potential risks associated with executing "commit" in a procedure.
Date: Mon, 13 Mar 2023 16:23:31 -0400
Message-ID: <2179740.1678739011@sss.pgh.pa.us> (raw)
In-Reply-To: <17837-9e65be9846767162@postgresql.org>
References: <17837-9e65be9846767162@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> Recently, I have noticed that executing "commit" in a procedure calls
> PreCommit_Portals in the kernel, which sets the resowner of the top level
> portal to null. However, subsequent statements still use this portal, and
> its resowner remains null. Is there any risk associated with this or could
> it lead to unexpected behavior?
I do not see any reason to believe there's a bug here. After the
COMMIT, CurrentResourceOwner won't be pointing at the portal's
resowner anymore, but at a resowner belonging to the newly-started
transaction (cf AtStart_ResourceOwner). The portal's resowner would
only have been used for resources that went away at commit, so it's
not needed anymore. Nor is there any code that would try to
re-install that resowner as active.
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, 857348270@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17837: The potential risks associated with executing "commit" in a procedure.
In-Reply-To: <2179740.1678739011@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