aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c12
1 files changed, 11 insertions, 1 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;