ri_triggers.c is endlessly long and repetitive. I want to clean it up a
bit (more).
I looked into all these switch cases for the unimplemented MATCH PARTIAL
option. I toyed around with how a MATCH PARTIAL implementation would
actually look like, and it likely wouldn't use the existing code
structure anyway, so let's just simplify this for now.
First, have ri_FetchConstraintInfo() check that riinfo->confmatchtype
is valid. Then we don't have to repeat that everywhere.
In the various referential action functions, we don't need to pay
attention to the match type at all right now, so remove all that code.
A future MATCH PARTIAL implementation would probably have some
conditions added to the present code, but it won't need an entirely
separate switch branch in each case.
In RI_FKey_fk_upd_check_required(), reorganize the code to make it
much simpler.
Separately, the comment style is also very generous and wasteful with
vertical space. That can be shrunk a bit.
Attached are some patches.
Final score:
branch wc -l
REL9_6_STABLE 3671
REL_10_STABLE 3668
REL_11_STABLE 3179
master 3034
patch 2695
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services