Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xL30W-00000001H84-24Vk for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Oct 2026 18:31:49 +0000 Received: from localhost ([127.0.0.1]:41182 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xL2zV-00000000aDk-1vNU for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Oct 2026 18:30:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:41034) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xL2zV-00000000aDa-0Kb0 for pgsql-hackers@lists.postgresql.org; Sun, 25 Oct 2026 18:30:45 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xL2zR-00000000tUT-3xfH for pgsql-hackers@postgresql.org; Sun, 25 Oct 2026 18:30:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 69PIUXj9344905; Sun, 25 Oct 2026 14:30:34 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 69PIUXj9344905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1792953034; bh=J6bBuSgnMQGYQvdTxXWXI5w+DgnMI4TTqNkC9qoT4rk=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=lG3HAkv12VlHlMr8tiVsfiCzHar1vsKv2zCXrxEACya2dlD8Xy8CUih6m4IsoZi0E lLNk0OFDhZIQAtHlnK8D9Ylesv8OycuRXjp0sviqsuiV7U1D0bTqSeet5FCH9M976w mjiwt4EIHONlJnGfsGog3Ly57p1txMmpqwceTvCU= From: Tom Lane To: "Joel Jacobson" cc: pgsql-hackers Subject: Re: [PATCH] Fix leaked hash scans in pg_listening_channels() In-reply-to: <069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com> References: <069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com> Comments: In-reply-to "Joel Jacobson" message dated "Mon, 19 Oct 2026 07:41:12 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <344903.1792953033.1@sss.pgh.pa.us> Date: Sun, 25 Oct 2026 14:30:33 -0400 Message-ID: <344904.1792953033@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Joel Jacobson" 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