From 1192b64496b69eaac81c1d20ce76d3f7ec2efd40 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Date: Mon, 25 Jul 2016 16:54:35 +0900
Subject: [PATCH] Remove validation status condition from equalTupleDescs.

This function checks given two tuple descriptors generates
incompatible tuples. Whether a check constraint is validated or not
doesn't break the compatibility.
---
 src/backend/access/common/tupdesc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
index b56d0e3..431eb73 100644
--- a/src/backend/access/common/tupdesc.c
+++ b/src/backend/access/common/tupdesc.c
@@ -342,10 +342,10 @@ DecrTupleDescRefCount(TupleDesc tupdesc)
 /*
  * Compare two TupleDesc structures for logical equality
  *
- * Note: we deliberately do not check the attrelid and tdtypmod fields.
- * This allows typcache.c to use this routine to see if a cached record type
- * matches a requested type, and is harmless for relcache.c's uses.
- * We don't compare tdrefcount, either.
+ * Note: we deliberately do not check the fields attrelid, tdtypmod and
+ * ccvalid of check constraints.  This allows typcache.c to use this routine
+ * to see if a cached record type matches a requested type, and is harmless
+ * for relcache.c's uses.  We don't compare tdrefcount, either.
  */
 bool
 equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
@@ -460,7 +460,6 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
 			{
 				if (strcmp(check1->ccname, check2->ccname) == 0 &&
 					strcmp(check1->ccbin, check2->ccbin) == 0 &&
-					check1->ccvalid == check2->ccvalid &&
 					check1->ccnoinherit == check2->ccnoinherit)
 					break;
 			}
-- 
1.8.3.1

