--- a/src/backend/catalog/partition.c
+++ b/src/backend/catalog/partition.c
@@ -189,7 +189,6 @@ RelationBuildPartitionDesc(Relation rel)
         inhoids = find_inheritance_children(RelationGetRelid(rel), NoLock);

         /* Collect bound spec nodes in a list */
-       i = 0;
         partoids = NIL;
         foreach(cell, inhoids)
         {
@@ -1508,7 +1508,6 @@ get_qual_for_range(PartitionKey key, 
