From f5bcd398addcbeb785f0513cf28cba5d1ecd2c8a Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 20 Jul 2012 12:33:34 -0400 Subject: connoinherit may be true only for CHECK constraints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code was setting it true for other constraints, which is bogus. Doing so caused bogus catalog entries for such constraints, and in particular caused an error to be raised when trying to drop a constraint of types other than CHECK from a table that has children, such as reported in bug #6712. In 9.2, additionally ignore connoinherit=true for other constraint types, to avoid having to force initdb; existing databases might already contain bogus catalog entries. Includes a catversion bump (in HEAD only). Bug report from Miroslav Ć ulc Analysis from Amit Kapila and Noah Misch; Amit also contributed the patch. --- src/backend/commands/tablecmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70e408cb6ea..d04429514d5 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -6039,7 +6039,7 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, NULL, true, /* islocal */ 0, /* inhcount */ - false); /* isnoinherit */ + true); /* isnoinherit */ /* * Create the triggers that will enforce the constraint. -- cgit v1.2.3