pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix some oversights in commit 2455ab488.
Date: Thu, 14 Mar 2019 22:36:43 +0000
Message-ID: <E1h4Yxv-0003X9-PY@gemulon.postgresql.org> (raw)

Fix some oversights in commit 2455ab488.

The idea was to generate all the junk in a destroyable subcontext rather
than leaking it in the caller's context, but partition_bounds_create was
still being called in the caller's context, allowing plenty of scope for
leakage.  Also, get_rel_relkind() was still being called in the rel's
rd_pdcxt, creating a risk of session-lifespan memory wastage.

Simplify the logic a bit while at it.  Also, reduce rd_pdcxt to
ALLOCSET_SMALL_SIZES, since it seems likely to not usually be big.

Probably something like this needs to be back-patched into v11,
but for now let's get some buildfarm testing on this.

Discussion: https://postgr.es/m/15943.1552601288@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/de570047993bd5fd65ad2bdf6b0acf5b8939bcb3

Modified Files
--------------
src/backend/partitioning/partdesc.c | 72 +++++++++++++++++--------------------
1 file changed, 33 insertions(+), 39 deletions(-)



Message-ID: <E1h4Yxv-0003X9-PY@gemulon.postgresql.org>
Permalink:  ../E1h4Yxv-0003X9-PY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h4Yxv-0003X9-PY@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix some oversights in commit 2455ab488.
  In-Reply-To: <E1h4Yxv-0003X9-PY@gemulon.postgresql.org>
  References: <E1h4Yxv-0003X9-PY@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