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
*