Change FK trigger naming convention to fix self-referential FKs.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 26 Oct 2011 17:19:42 +0000 (13:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 26 Oct 2011 17:19:42 +0000 (13:19 -0400)
commit1e3b21dd5e1070d301153690c1751bef74f03fa4
tree85d6ede0a5ac8c3b6eea9285de474a0454ee4c3f
parent58958726ffaec8d1a5d6a63f648443886fde8a21
Change FK trigger naming convention to fix self-referential FKs.

Use names like "RI_ConstraintTrigger_a_NNNN" for FK action triggers and
"RI_ConstraintTrigger_c_NNNN" for FK check triggers.  This ensures the
action trigger fires first in self-referential cases where the very same
row update fires both an action and a check trigger.  This change provides
a non-probabilistic solution for bug #6268, at the risk that it could break
client code that is making assumptions about the exact names assigned to
auto-generated FK triggers.  Hence, change this in HEAD only.  No need for
forced initdb since old triggers continue to work fine.
src/backend/commands/tablecmds.c