From c076f3d74af6e4836206142446bdcc2f93e149d6 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 3 Sep 2018 12:58:42 -0300 Subject: Remove pg_constraint.conincluding This column was added in commit 8224de4f42cc ("Indexes with INCLUDE columns and their support in B-tree") to ease writing the ruleutils.c supporting code for that feature, but it turns out to be unnecessary -- we can do the same thing with just one more syscache lookup. Even the documentation for the new column being removed in this commit is awkward. Discussion: https://postgr.es/m/20180902165018.33otxftp3olgtu4t@alvherre.pgsql --- src/backend/catalog/pg_constraint.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/backend/catalog/pg_constraint.c') diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index 7a6d158f898..ea844413608 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -85,7 +85,6 @@ CreateConstraintEntry(const char *constraintName, bool nulls[Natts_pg_constraint]; Datum values[Natts_pg_constraint]; ArrayType *conkeyArray; - ArrayType *conincludingArray; ArrayType *confkeyArray; ArrayType *conpfeqopArray; ArrayType *conppeqopArray; @@ -116,21 +115,6 @@ CreateConstraintEntry(const char *constraintName, else conkeyArray = NULL; - if (constraintNTotalKeys > constraintNKeys) - { - Datum *conincluding; - int j = 0; - int constraintNIncludedKeys = constraintNTotalKeys - constraintNKeys; - - conincluding = (Datum *) palloc(constraintNIncludedKeys * sizeof(Datum)); - for (i = constraintNKeys; i < constraintNTotalKeys; i++) - conincluding[j++] = Int16GetDatum(constraintKey[i]); - conincludingArray = construct_array(conincluding, constraintNIncludedKeys, - INT2OID, 2, true, 's'); - } - else - conincludingArray = NULL; - if (foreignNKeys > 0) { Datum *fkdatums; @@ -204,11 +188,6 @@ CreateConstraintEntry(const char *constraintName, else nulls[Anum_pg_constraint_conkey - 1] = true; - if (conincludingArray) - values[Anum_pg_constraint_conincluding - 1] = PointerGetDatum(conincludingArray); - else - nulls[Anum_pg_constraint_conincluding - 1] = true; - if (confkeyArray) values[Anum_pg_constraint_confkey - 1] = PointerGetDatum(confkeyArray); else -- cgit v1.2.3