pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reset memory context once per tuple in validateForeignKeyConstra
Date: Mon, 08 Apr 2019 05:52:55 +0000
Message-ID: <E1hDNDD-0006vj-SP@gemulon.postgresql.org> (raw)

Reset memory context once per tuple in validateForeignKeyConstraint.

When using tableam ExecFetchSlotHeapTuple() might return a separately
allocated tuple. We could use the shouldFree argument to explicitly
free it, but it seems more robust to to protect

Also add a CHECK_FOR_INTERRUPTS() after each tuple. It's likely that
each AM has (heap does) a CFI somewhere in the relevant path, but it
seems more robust to have one in validateForeignKeyConstraint()
itself.

Note that this only affects the cases that couldn't be optimized to be
verified with a query.

Author: Andres Freund
Reviewed-By: Tom Lane (in an earlier version)
Discussion:
    https://postgr.es/m/19030.1554574075@sss.pgh.pa.us
    https://postgr.es/m/CAKJS1f_SHKcPYMsi39An5aUjhAcEMZb6Cx1Sj1QWEWSiKJkBVQ@mail.gmail.com
    https://postgr.es/m/20180711185628.mrvl46bjgk2uxoki@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4c9e1bd0a37e7b79dfc797dd91627336e871c1b0

Modified Files
--------------
src/backend/commands/tablecmds.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)



Message-ID: <E1hDNDD-0006vj-SP@gemulon.postgresql.org>
Permalink:  ../E1hDNDD-0006vj-SP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hDNDD-0006vj-SP@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: andres@anarazel.de
  Subject: Re: pgsql: Reset memory context once per tuple in validateForeignKeyConstra
  In-Reply-To: <E1hDNDD-0006vj-SP@gemulon.postgresql.org>
  References: <E1hDNDD-0006vj-SP@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