Remove unnecessary opening of other relation in RI_FKey_keyequal_upd_pk
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Feb 2008 23:00:38 +0000 (23:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Feb 2008 23:00:38 +0000 (23:00 +0000)
commit9be73f61c6388abef9e5576bfdd5431c15867baf
treeb2be4231268f4b7abf0d43e9064d65b20492cb48
parent68c41bba3a69d664bfe077545eaa7d33e0608caf
Remove unnecessary opening of other relation in RI_FKey_keyequal_upd_pk
and RI_FKey_keyequal_upd_fk, as well as no-longer-needed calls of
ri_BuildQueryKeyFull.  Aside from saving a few cycles, this avoids needless
deadlock risks when an update is not changing the columns that participate
in an RI constraint.  Per a gripe from Alexey Nalbat.

Back-patch to 8.3.  Earlier releases did have a need to open the other
relation due to the way in which they retrieved information about the RI
constraint, so this problem unfortunately can't easily be improved pre-8.3.

Tom Lane and Stephan Szabo
src/backend/utils/adt/ri_triggers.c