pgsql: Share RI trigger code between NO ACTION and RESTRICT cases.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Share RI trigger code between NO ACTION and RESTRICT cases.
Date: 2012-06-19 18:32:04
Message-ID: E1Sh3Dg-0005s4-9T@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Share RI trigger code between NO ACTION and RESTRICT cases.

These triggers are identical except for whether ri_Check_Pk_Match is to be
called, so factor out the common code to save a couple hundred lines.

Also, eliminate null-column checks in ri_Check_Pk_Match, since they're
duplicate with the calling functions and require unnecessary complication
in its API statement.

Simplify the way code is shared between RI_FKey_check_ins and
RI_FKey_check_upd, too.

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 778 +++++++++--------------------
src/test/regress/expected/foreign_key.out | 26 +
src/test/regress/sql/foreign_key.sql | 22 +
3 files changed, 282 insertions(+), 544 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2012-06-19 21:13:35 pgsql: Remove confusing half sentence from legal notice
Previous Message Tom Lane 2012-06-19 02:46:03 pgsql: Improve comments about why SET DEFAULT triggers must recheck for