Decibel! <decibel@decibel.org> writes:
> But... taking a quick look at RI_FKey_check in backend/utils/adt/
> ri_triggers.c, I don't see it checking to see if the FK has changed,
> which seems odd. I would think that if the FK fields haven't changed
> that there's no need to perform the check.
You looked in the wrong place; see AfterTriggerSaveEvent in
commands/trigger.c
regards, tom lane