public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: pg_stat_statements: Set PlannedStmt to NULL after nested utility
Date: Wed, 13 May 2026 06:48:43 +0000
Message-ID: <[email protected]> (raw)

pg_stat_statements: Set PlannedStmt to NULL after nested utility execution

As mentioned in 8268e41aca23, pgss_ProcessUtility() may free the
PlannedStmt after an internal ROLLBACK.  This commit sets the
PlannedStmt "pstmt" to NULL once it is no longer safe to rely on it,
making bugs similar to the one fixed by the previous commit easier to
detect.

Suggested-by: Andres Freund <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/66366217822e23a00251f6ba3743d8e5675fcfc2

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c | 1 +
1 file changed, 1 insertion(+)



reply

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: pg_stat_statements: Set PlannedStmt to NULL after nested utility
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox