Skip site navigation (1) Skip section navigation (2)

pgsql: Improve conversion of legacy CREATE CONSTRAINT TRIGGER

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve conversion of legacy CREATE CONSTRAINT TRIGGER
Date: 2007-11-05 19:00:25
Message-ID: 20071105190025.DCD34754229@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Improve conversion of legacy CREATE CONSTRAINT TRIGGER representation of
foreign keys, one more time.  Insist on matching up all three triggers before
we create a constraint; this will avoid creation of duplicate constraints
in scenarios where a broken FK constraint was repaired by re-adding the
constraint without removing the old partial trigger set.  Basically, this will
work nicely in all cases where the FK was actually functioning correctly in
the database that was dumped.  It will fail to restore an FK in just one case
where we theoretically could restore it: where we find the referenced table's
triggers and not the referencing table's trigger.  However, in such a scenario
it's likely that the user doesn't even realize he still has an FK at all
(since the more-likely-to-fail cases aren't enforced), and we'd probably not
accomplish much except to cause the reload to fail because the data doesn't
meet the FK constraint.  Also make the NOTICE logging still more verbose, by
adding detail about which of the triggers were found.  This seems about all
we can do without solving the problem of getting the user's attention at
session end.

Modified Files:
--------------
    pgsql/src/backend/commands:
        trigger.c (r1.221 -> r1.222)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.221&r2=1.222)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-11-05 20:57:24
Subject: pgsql: Fix deprecated-by-C-spec usage: storage class should come before
Previous:From: Bruce MomjianDate: 2007-11-05 17:43:20
Subject: pgsql: Document that configure option only affects contrib:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group