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@postgresql.org
Subject: pgsql: Check for pending trigger events on far end when dropping an FK
Date: Fri, 25 Nov 2016 18:45:17 +0000
Message-ID: <E1cALUr-0000m9-0F@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Check for pending trigger events on far end when dropping an FK constraint.

When dropping a foreign key constraint with ALTER TABLE DROP CONSTRAINT,
we refuse the drop if there are any pending trigger events on the named
table; this ensures that we won't remove the pg_trigger row that will be
consulted by those events.  But we should make the same check for the
referenced relation, else we might remove a due-to-be-referenced pg_trigger
row for that relation too, resulting in "could not find trigger NNN" or
"relation NNN has no triggers" errors at commit.  Per bug #14431 from
Benjie Gillam.  Back-patch to all supported branches.

Report: <20161124114911.6530.31200@wrigleys.postgresql.org>

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6cbe84c826b51a159825e9843184c7b4a740e4ae

Modified Files
--------------
src/backend/commands/tablecmds.c          | 18 ++++++++++++++++++
src/test/regress/expected/foreign_key.out | 13 +++++++++++++
src/test/regress/sql/foreign_key.sql      | 13 +++++++++++++
3 files changed, 44 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)

Message-ID: <E1cALUr-0000m9-0F@gemulon.postgresql.org>
Permalink:  ../E1cALUr-0000m9-0F@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cALUr-0000m9-0F@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: Check for pending trigger events on far end when dropping an FK
  In-Reply-To: <E1cALUr-0000m9-0F@gemulon.postgresql.org>
  References: <E1cALUr-0000m9-0F@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