pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Get rid of copy_partition_key
Date: Thu, 21 Dec 2017 17:43:14 +0000
Message-ID: <E1eS4sE-0006Ba-1G@gemulon.postgresql.org> (raw)

Get rid of copy_partition_key

That function currently exists to avoid leaking memory in
CacheMemoryContext in case of trouble while the partition key is being
built, but there's a better way: allocate everything in a memcxt that
goes away if the current (sub)transaction fails, and once the partition
key is built and no further errors can occur, make the memcxt permanent
by making it a child of CacheMemoryContext.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/20171027172730.eh2domlkpn4ja62m@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8a0596cb656e357c391cccf12854beb2e05f3901

Modified Files
--------------
src/backend/utils/cache/relcache.c | 71 +++++---------------------------------
1 file changed, 9 insertions(+), 62 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1eS4sE-0006Ba-1G@gemulon.postgresql.org>
Permalink:  ../E1eS4sE-0006Ba-1G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eS4sE-0006Ba-1G@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Get rid of copy_partition_key
  In-Reply-To: <E1eS4sE-0006Ba-1G@gemulon.postgresql.org>
  References: <E1eS4sE-0006Ba-1G@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