aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2014-03-23 02:13:43 -0400
committerNoah Misch <noah@leadboat.com>2014-03-23 02:15:09 -0400
commit1d1b32a9530ee20be98d4617b46f517f0d0250f2 (patch)
treefdc17cb33572ff59bddf62e90b0a6a6e83476fba
parentee42d8f10b65593aab768438665000aec070f6c2 (diff)
downloadpostgresql-1d1b32a9530ee20be98d4617b46f517f0d0250f2.tar.gz
postgresql-1d1b32a9530ee20be98d4617b46f517f0d0250f2.zip
Address ccvalid/ccnoinherit in TupleDesc support functions.
equalTupleDescs() neglected both of these ConstrCheck fields, and CreateTupleDescCopyConstr() neglected ccnoinherit. At this time, the only known behavior defect resulting from these omissions is constraint exclusion disregarding a CHECK constraint validated by an ALTER TABLE VALIDATE CONSTRAINT statement issued earlier in the same transaction. Back-patch to 9.2, where these fields were introduced.
-rw-r--r--src/backend/access/common/tupdesc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
index 9884adc2dac..897ee23fbc5 100644
--- a/src/backend/access/common/tupdesc.c
+++ b/src/backend/access/common/tupdesc.c
@@ -203,6 +203,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
if (constr->check[i].ccbin)
cpy->check[i].ccbin = pstrdup(constr->check[i].ccbin);
cpy->check[i].ccvalid = constr->check[i].ccvalid;
+ cpy->check[i].ccnoinherit = constr->check[i].ccnoinherit;
}
}
@@ -416,7 +417,9 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
for (j = 0; j < n; check2++, j++)
{
if (strcmp(check1->ccname, check2->ccname) == 0 &&
- strcmp(check1->ccbin, check2->ccbin) == 0)
+ strcmp(check1->ccbin, check2->ccbin) == 0 &&
+ check1->ccvalid == check2->ccvalid &&
+ check1->ccnoinherit == check2->ccnoinherit)
break;
}
if (j >= n)