Re: HeapTupleHeaderData Layout description - Mailing list pgsql-docs

From benj.dev@laposte.net
Subject Re: HeapTupleHeaderData Layout description
Date
Msg-id e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net
Whole thread Raw
In response to Re: HeapTupleHeaderData Layout description  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: HeapTupleHeaderData Layout description  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
Le 22/01/2021 à 17:49, Tom Lane a écrit :
> benj.dev@laposte.net writes:
>> In https://www.postgresql.org/docs/13/storage-page-layout.html<br>
>> we can find on § 68.6.1. Table Row Layout<br>
>> the Table 68.4. HeapTupleHeaderData Layout<br>
>> <br>
>> When additionning Length of differents Fields taht are present we obtain  atotal of<br>
>> 4+4+4+4+6+2+2+1 = 27<br>
>
> I think you missed the point that t_cid overlays with t_xvac.
>
>             regards, tom lane
>

Hi,
Thank you for this point. It's more clear.

So in fact the error (with number 27) was in the documentation for
version before postgres 8.3.

In version >=8.3, the overlays precision could be added into sentence
"XID for VACUUM operation moving a row version" => "XID for VACUUM
operation moving a row version (overlays with t_cid)"
or
Maybe show t_cid and t_xvac in the same cell into the array could be
more clear
Example :
|===========|===============|=========|================================|
|Field      |Type           |Length   |Description                     |
|===========|===============|=========|================================|
|t_xmin     |TransactionId  |4 octets |insert XID stamp                |
|-----------|---------------|---------|--------------------------------|
|t_xmax     |TransactionId  |4 octets |delete XID stamp                |
|-----------|---------------|---------|--------------------------------|
|t_cid      |CommandId      |         |insert and/or delete CID stamp  |
|t_xvac     |TransactionId  |         |XID for VACUUM operation moving |
|           |               |         |a row version                   |
|           |               |4 octets |(t_cid and t_xvax are overlayed)|
|-----------|---------------|---------|--------------------------------|
|t_ctid     |ItemPointerData|6 octets |current TID of this or newer row|
|           |               |         |version                         |
|-----------|---------------|---------|--------------------------------|
|t_infomask2|uint16         |2 octets |number of attributes, plus      |
|           |               |         |various flag bits               |
|-----------|---------------|---------|--------------------------------|
|t_infomask |uint16         |2 octets |various flag bits               |
|-----------|---------------|---------|--------------------------------|
|t_hoff     |uint8          |1 octet  |offset to user data             |
|===========|===============|=========|================================|

Thanks,
Regards



pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: HeapTupleHeaderData Layout description
Next
From: Tom Lane
Date:
Subject: Re: HeapTupleHeaderData Layout description