pgsql: Fix overlooked relcache invalidation in ALTER TABLE ... ALTER CO

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix overlooked relcache invalidation in ALTER TABLE ... ALTER CO
Date: 2015-05-03 15:30:33
Message-ID: E1Yovqj-0007R6-Ca@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix overlooked relcache invalidation in ALTER TABLE ... ALTER CONSTRAINT.

When altering the deferredness state of a foreign key constraint, we
correctly updated the catalogs and then invalidated the relcache state for
the target relation ... but that's not the only relation with relevant
triggers. Must invalidate the other table as well, or the state change
fails to take effect promptly for operations triggered on the other table.
Per bug #13224 from Christian Ullrich.

In passing, reorganize regression test case for this feature so that it
isn't randomly injected into the middle of an unrelated test sequence.

Oversight in commit f177cbfe676dc2c7ca2b206c54d6bf819feeea8b. Back-patch
to 9.4 where the faulty code was added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a4820434c1a62e0c5f4051a31ad8b4a11f0a6ad7

Modified Files
--------------
src/backend/commands/tablecmds.c | 22 ++++++++++++--
src/test/regress/expected/foreign_key.out | 43 ++++++++++++++------------
src/test/regress/sql/foreign_key.sql | 47 +++++++++++++++++------------
3 files changed, 70 insertions(+), 42 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-05-03 18:27:16 Re: [COMMITTERS] pgsql: Add transforms feature
Previous Message Andrew Dunstan 2015-05-03 13:37:51 pgsql: fix escaping of brackets for m4 broken in b6b2149e48aa61981ae019