From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pageinspect: Fix relcache leak in gist_page_items().
Date: Sun, 17 Jan 2021 22:47:32 +0000
Message-ID: <E1l1GpY-0003Rk-38@gemulon.postgresql.org> (raw)
pageinspect: Fix relcache leak in gist_page_items().
The gist_page_items() function opened the index relation on first call and
closed it on the last call. But there's no guarantee that the function is
run to completion, leading to a relcache leak and warning at the end of
the transaction. To fix, refactor the function to return all the rows in
one call, as a tuplestore.
Reported-by: Tom Lane
Discussion: https://www.postgresql.org/message-id/234863.1610916631%40sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/04eb75e783ba49ca2e0e75088d6590b64be8ed4d
Modified Files
--------------
contrib/pageinspect/gistfuncs.c | 170 +++++++++++++++++-----------------------
1 file changed, 74 insertions(+), 96 deletions(-)
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-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: pageinspect: Fix relcache leak in gist_page_items().
In-Reply-To: <E1l1GpY-0003Rk-38@gemulon.postgresql.org>
References: <E1l1GpY-0003Rk-38@gemulon.postgresql.org>
* 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