diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/tablecmds.c | 12 | ||||
-rw-r--r-- | src/backend/commands/trigger.c | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70e408cb6ea..6ff08a29cc1 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. @@ -6948,6 +6948,16 @@ ATExecDropConstraint(Relation rel, const char *constrName, is_no_inherit_constraint = con->connoinherit; /* + * XXX as a special hack, we turn on no-inherit here unconditionally + * except for CHECK constraints. This is because 9.2 until beta2 + * contained a bug that marked it false for all constraints, even + * though it was only supported false for CHECK constraints. + * See bug #6712. + */ + if (con->contype != CONSTRAINT_CHECK) + is_no_inherit_constraint = true; + + /* * Perform the actual constraint deletion */ conobj.classId = ConstraintRelationId; diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 4399a274465..70721a272d0 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -459,7 +459,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, NULL, true, /* islocal */ 0, /* inhcount */ - false); /* isnoinherit */ + true); /* isnoinherit */ } /* |