Remove equalPartitionDescs().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Dec 2019 19:45:57 +0000 (14:45 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Dec 2019 19:45:57 +0000 (14:45 -0500)
This is dead code in the wake of the previous commit.
We can always add it back if we need it again someday.

Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com

src/backend/partitioning/partdesc.c
src/include/partitioning/partdesc.h

index a6e397940b2f8d9cfd960613b5db111d47252c2f..694ed923e02a3d2a7030732e05d1670f70a4d3dd 100644 (file)
@@ -351,60 +351,6 @@ DestroyPartitionDirectory(PartitionDirectory pdir)
        RelationDecrementReferenceCount(pde->rel);
 }
 
-/*
- * equalPartitionDescs
- *     Compare two partition descriptors for logical equality
- */
-bool
-equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
-                   PartitionDesc partdesc2)
-{
-   int         i;
-
-   if (partdesc1 != NULL)
-   {
-       if (partdesc2 == NULL)
-           return false;
-       if (partdesc1->nparts != partdesc2->nparts)
-           return false;
-
-       Assert(key != NULL || partdesc1->nparts == 0);
-
-       /*
-        * Same oids? If the partitioning structure did not change, that is,
-        * no partitions were added or removed to the relation, the oids array
-        * should still match element-by-element.
-        */
-       for (i = 0; i < partdesc1->nparts; i++)
-       {
-           if (partdesc1->oids[i] != partdesc2->oids[i])
-               return false;
-       }
-
-       /*
-        * Now compare partition bound collections.  The logic to iterate over
-        * the collections is private to partition.c.
-        */
-       if (partdesc1->boundinfo != NULL)
-       {
-           if (partdesc2->boundinfo == NULL)
-               return false;
-
-           if (!partition_bounds_equal(key->partnatts, key->parttyplen,
-                                       key->parttypbyval,
-                                       partdesc1->boundinfo,
-                                       partdesc2->boundinfo))
-               return false;
-       }
-       else if (partdesc2->boundinfo != NULL)
-           return false;
-   }
-   else if (partdesc2 != NULL)
-       return false;
-
-   return true;
-}
-
 /*
  * get_default_oid_from_partdesc
  *
index 825bdd76ab50c5fbe8e54369220e8c0a014f97da..23be527a5a4f19e1514f9dad5f8dd750cce4546f 100644 (file)
@@ -38,7 +38,4 @@ extern void DestroyPartitionDirectory(PartitionDirectory pdir);
 
 extern Oid get_default_oid_from_partdesc(PartitionDesc partdesc);
 
-extern bool equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
-                               PartitionDesc partdesc2);
-
 #endif                         /* PARTCACHE_H */