pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Fix leaked hash scans in pg_listening_channels()
Date: Sun, 25 Oct 2026 14:30:33 -0400
Message-ID: <344904.1792953033@sss.pgh.pa.us> (raw)
In-Reply-To: <069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com>
References: <069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com>

"Joel Jacobson" <joel@compiler.org> writes:
> I found a hash scan leak in pg_listening_channels(), introduced by
> 282b1cde9d.

Good catch.

> Attached patch uses InitMaterializedSRF() to complete the scan
> before returning rows, following 257c8231bf.

I am wondering why you used MAT_SRF_USE_EXPECTED_DESC?
AFAICT that's only needed in functions returning "setof record",
and with a fixed output type it's usual to just pass flags = 0.

			regards, tom lane






view thread (7+ messages)  latest in thread

Message-ID: <344904.1792953033@sss.pgh.pa.us>
Permalink:  ../344904.1792953033@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/344904.1792953033@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, joel@compiler.org
  Subject: Re: [PATCH] Fix leaked hash scans in pg_listening_channels()
  In-Reply-To: <344904.1792953033@sss.pgh.pa.us>
  References: <069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com> <344904.1792953033@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