On 2021-Feb-21, Michael Paquier wrote:

> On Sat, Feb 20, 2021 at 12:25:58PM -0300, Álvaro Herrera wrote:

> > Hmm.  Alternatively, maybe it'd make sense to change
> > HeapTupleHeaderSetMovedPartition to use ItemPointerSetMovedPartitions
> > instead of doing ItemPointerSet directly.  But that looks mostly
> > pointless, since the extensibility aspect of this interface has been
> > superseded by table AM work.  I agree we should just remove the macro
> > and update the comment as you suggest.
> 
> Thanks.  So you will do this change in the same commit, right?

I changed my mind on this after noticing that
ItemPointerIndicatesMovedPartitions has a few callers; leaving the
interface incomplete/asymmetric would be worse.  So I propose to do
this.

diff --git a/src/include/access/htup_details.h 
b/src/include/access/htup_details.h
index 7c62852e7f..86b3622b5e 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -443,11 +443,10 @@ do { \
 )
 
 #define HeapTupleHeaderIndicatesMovedPartitions(tup) \
-       (ItemPointerGetOffsetNumber(&(tup)->t_ctid) == 
MovedPartitionsOffsetNumber && \
-        ItemPointerGetBlockNumberNoCheck(&(tup)->t_ctid) == 
MovedPartitionsBlockNumber)
+       ItemPointerIndicatesMovedPartitions(&(tup)->t_ctid)
 
 #define HeapTupleHeaderSetMovedPartitions(tup) \
-       ItemPointerSet(&(tup)->t_ctid, MovedPartitionsBlockNumber, 
MovedPartitionsOffsetNumber)
+       ItemPointerSetMovedPartitions(&(tup)->t_ctid)
 
 #define HeapTupleHeaderGetDatumLength(tup) \
        VARSIZE(tup)

-- 
Álvaro Herrera       Valdivia, Chile
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)


Reply via email to