[PATCH] Fix leaked hash scans in pg_listening_channels()

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Fix leaked hash scans in pg_listening_channels()
Date: 2026-10-19 05:41:12
Message-ID: 069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I found a hash scan leak in pg_listening_channels(), introduced by
282b1cde9d.

LISTEN ch;
SELECT pg_listening_channels() LIMIT 1;

The SELECT emits a leak warning in the server logs.

Repeated early exits can exhaust the hash scan limit and cause a
server crash.

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

/Joel

Attachment Content-Type Size
0001-Fix-leaked-hash-scans-in-pg_listening_channels.patch application/octet-stream 4.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajit Awekar 2026-10-19 05:47:41 Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table
Previous Message Chao Li 2026-10-19 05:39:14 Re: query_int wrongly parses zero-padded input