pgsql: Change FK trigger naming convention to fix self-referential FKs.

Lists: pgsql-committers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change FK trigger naming convention to fix self-referential FKs.
Date: 2011-10-26 17:19:53
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1e3b21dd5e1070d301153690c1751bef74f03fa4

Modified Files
--------------
src/backend/commands/tablecmds.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)