Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 42f74f4

Browse files
committed
Remove equalPartitionDescs().
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
1 parent 5b93123 commit 42f74f4

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

src/backend/partitioning/partdesc.c

-54
Original file line numberDiff line numberDiff line change
@@ -351,60 +351,6 @@ DestroyPartitionDirectory(PartitionDirectory pdir)
351351
RelationDecrementReferenceCount(pde->rel);
352352
}
353353

354-
/*
355-
* equalPartitionDescs
356-
* Compare two partition descriptors for logical equality
357-
*/
358-
bool
359-
equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
360-
PartitionDesc partdesc2)
361-
{
362-
int i;
363-
364-
if (partdesc1 != NULL)
365-
{
366-
if (partdesc2 == NULL)
367-
return false;
368-
if (partdesc1->nparts != partdesc2->nparts)
369-
return false;
370-
371-
Assert(key != NULL || partdesc1->nparts == 0);
372-
373-
/*
374-
* Same oids? If the partitioning structure did not change, that is,
375-
* no partitions were added or removed to the relation, the oids array
376-
* should still match element-by-element.
377-
*/
378-
for (i = 0; i < partdesc1->nparts; i++)
379-
{
380-
if (partdesc1->oids[i] != partdesc2->oids[i])
381-
return false;
382-
}
383-
384-
/*
385-
* Now compare partition bound collections. The logic to iterate over
386-
* the collections is private to partition.c.
387-
*/
388-
if (partdesc1->boundinfo != NULL)
389-
{
390-
if (partdesc2->boundinfo == NULL)
391-
return false;
392-
393-
if (!partition_bounds_equal(key->partnatts, key->parttyplen,
394-
key->parttypbyval,
395-
partdesc1->boundinfo,
396-
partdesc2->boundinfo))
397-
return false;
398-
}
399-
else if (partdesc2->boundinfo != NULL)
400-
return false;
401-
}
402-
else if (partdesc2 != NULL)
403-
return false;
404-
405-
return true;
406-
}
407-
408354
/*
409355
* get_default_oid_from_partdesc
410356
*

src/include/partitioning/partdesc.h

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ extern void DestroyPartitionDirectory(PartitionDirectory pdir);
3838

3939
extern Oid get_default_oid_from_partdesc(PartitionDesc partdesc);
4040

41-
extern bool equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
42-
PartitionDesc partdesc2);
43-
4441
#endif /* PARTCACHE_H */

0 commit comments

Comments
 (0)