Re: Fix unsafe PlannedStmt access in pg_stat_statements

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Subject: Re: Fix unsafe PlannedStmt access in pg_stat_statements
Date: 2026-05-13 04:26:36
Message-ID: agP9fFXriRN1HR5k@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 12, 2026 at 11:00:16AM +0200, Andres Freund wrote:
> Seems like the code should make this clearer, by simply unsetting
> pstmt at the point it becomes unsafe to use?

Sure, we could do that as well and crash hard if something decides to
do the same mistake. Like the simple patch attached for example? I
am not sure if we need to update the comment. It's pretty clear what
the intention is, at least to me.
--
Michael

Attachment Content-Type Size
pgss-pstmt.patch text/plain 577 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2026-05-13 04:34:41 Re: Add a greedy join search algorithm to handle large join problems
Previous Message Henson Choi 2026-05-13 04:15:20 Re: Row pattern recognition