pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: benj.dev@laposte.net
To: pgsql-docs@lists.postgresql.org
Subject: Re: HeapTupleHeaderData Layout description
Date: Fri, 22 Jan 2021 19:08:03 +0100
Message-ID: <e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net> (raw)
In-Reply-To: <1165901.1611334152@sss.pgh.pa.us>
References: <658235472.1027001.1611323445204@wlpnf0217>
	<1165901.1611334152@sss.pgh.pa.us>

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&nbsp; 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





view thread (4+ messages)  latest in thread

Message-ID: <e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net>
Permalink:  ../e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net/
Also on:    postgresql.org/message-id/e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: benj.dev@laposte.net, pgsql-docs@lists.postgresql.org
  Subject: Re: HeapTupleHeaderData Layout description
  In-Reply-To: <e83c6378-f298-2c81-5276-53b8f1c1bc71@laposte.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox