pgsql: Get rid of copy_partition_key

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Get rid of copy_partition_key
Date: 2017-12-21 17:43:14
Message-ID: E1eS4sE-0006Ba-1G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-12-21 17:57:59 pgsql: Rearrange execution of PARAM_EXTERN Params for plpgsql's benefit
Previous Message Alvaro Herrera 2017-12-21 16:37:15 pgsql: Fix typo

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-12-21 17:55:24 Re: ddd
Previous Message David Fetter 2017-12-21 17:38:01 Re: AS OF queries