Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wJboN-0003pE-05 for pgsql-novice@arkaria.postgresql.org; Sun, 03 May 2026 18:45:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJboL-004FmG-0a for pgsql-novice@arkaria.postgresql.org; Sun, 03 May 2026 18:45:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wJboK-004Fm7-2k for pgsql-novice@lists.postgresql.org; Sun, 03 May 2026 18:45:00 +0000 Received: from mx1.alte-leipziger.de ([91.217.145.231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wJboI-00000000JnN-14ja for pgsql-novice@lists.postgresql.org; Sun, 03 May 2026 18:45:00 +0000 X-CSE-ConnectionGUID: Oc7VQfReQT+57dn3XO7Q2g== X-CSE-MsgGUID: a0Jna2OlRn6yzsU1i0v59w== From: "Subramanian,Ramachandran" To: "pgsql-novice@lists.postgresql.org" Subject: Trying to understand Tuple Header Thread-Topic: Trying to understand Tuple Header Thread-Index: AdzbKsGfDMGkV6ozTPSpjePFe3rtgw== Date: Sun, 3 May 2026 18:44:53 +0000 Message-ID: <0f8e5544ae8a412bb637fcc3d15f8aaa@alte-leipziger.de> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmase-matchedrid: cd4bo9JS5DQRz9YLdsFULH0tCKdnhB58Wyp9qNukZ1BvTOI9YAS51j4C ii3pSpSYJaQokcGSq+gsEFWH07Y1pf1N8S9tF60fwsybRluqYXpk9EiT3DtQkOUH2+bY0IGE x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No x-tmase-result: 10--5.490600-8.000000 x-tm-snts-smtp: 1816355C08E01CD14C7AFD025F2C7D3E6D1115BC3C02A916F21DC318EDC7EFC92000:8 x-alsentwithgood: false Content-Type: multipart/alternative; boundary="_000_0f8e5544ae8a412bb637fcc3d15f8aaaalteleipzigerde_" MIME-Version: 1.0 X-GBS-PROC: U4I20n4ULWTIC0V85elGeSeuNQRw8ZJFqQQaJBP0QrVSAhpBnuHpaQnD/l3qe+kW X-GBS-PROCJOB: =?utf-8?Q?Amw3LTWPWESsB9r636PMrIasg2h9IZqaYI4QhKJ/Bdh/VrqamOvFqQwpUJAt?= =?utf-8?Q?B/Cg9K5aIJxMu+LuuGIZitQziaQp7WQXlzZUsi6TmPJEpEBy7LNMYTE0NNTI?= =?utf-8?Q?oSGOQJJcx0ldZzTzCP3ubANZU02DgR7PGnrdQMyn1qaS91z+SpA=3D?= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_0f8e5544ae8a412bb637fcc3d15f8aaaalteleipzigerde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I created a table called One_Page_Wonder and inserted 3 rows in it. I up= dated row 2 and row 3 . I looked at the tuples. Row 1 is pristine, Row 2 and 3 have t_xmin and t_xmax values to show the = updates and older version of the tuples. So far no confusion. Then I truncated the table and inserted 1st row and comitted it and inser= ted 4th row and rolled it back. The tuple for 4th row that I rolled back looks identical to the 1st row t= hat I commited !!!! If I did not do a SELECT on One_Page_Wonder and just looked at the raw pa= ge, I would have concluded that both the tuples are valid and active and = comitted. How does postgres know that this 4th tuple has been rolled back =3F Plea= se help me learn that. Regards Ram SELECT * FROM heap_page_items(get_raw_page(=27One_Page_Wonder=27,0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_field3 | t_ctid | t= _infomask2 | t_infomask | t_hoff | t_bits | t_oid | = t_data ----+--------+----------+--------+--------+--------+----------+--------+-= ------------+------------+--------+--------+-------+---------------------= ----------------------------------------------- 1 | 8136 | 1 | 56 | 3561 | 0 | 0 | (0,1) | = 3 | 2050 | 24 | | | =5Cx0100000027466972= 737420726f7720496e736572746564008abd6087eef30200 2 | 8080 | 1 | 56 | 3562 | 3565 | 0 | (0,5) | = 16387 | 258 | 24 | | | =5Cx0200000027536563= 6f6e6420726f77496e736572746564000fc66087eef30200 3 | 8024 | 1 | 56 | 3563 | 3564 | 0 | (0,4) | = 16387 | 258 | 24 | | | =5Cx0300000027546869= 72642020726f77496e73657274656400cecb6087eef30200 4 | 7968 | 1 | 56 | 3564 | 0 | 0 | (0,4) | = 32771 | 10242 | 24 | | | =5Cx0300000021557064= 617465645f3372645f726f7700000000cecb6087eef30200 5 | 7912 | 1 | 56 | 3565 | 0 | 0 | (0,5) | = 32771 | 10242 | 24 | | | =5Cx0200000021557064= 617465645f3272645f726f77000000000fc66087eef30200 (5 rows) SELECT * FROM One_Page_Wonder ; id | text | time_stamp ----+--------------------+---------------------------- 1 | First row Inserted | 2026-05-03 20:35:52.451466 3 | Updated_3rd_row | 2026-05-03 20:35:52.455118 2 | Updated_2rd_row | 2026-05-03 20:35:52.453647 (3 rows) TRUNCATE TABLE One_Page_Wonder; TRUNCATE TABLE INSERT INTO One_Page_Wonder (Id,Text) VALUES (1, =27First row Inserted=27); INSERT 0 1 BEGIN; BEGIN SELECT pg_current_xact_id(); pg_current_xact_id -------------------- 3568 (1 row) INSERT INTO One_Page_Wonder (Id,Text) VALUES (4, =27Fourth rowInserted=27); INSERT 0 1 ROLLBACK; ROLLBACK SELECT * FROM heap_page_items(get_raw_page(=27One_Page_Wonder=27,0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_field3 | t_ctid | t= _infomask2 | t_infomask | t_hoff | t_bits | t_oid | = t_data ----+--------+----------+--------+--------+--------+----------+--------+-= ------------+------------+--------+--------+-------+---------------------= ----------------------------------------------- 1 | 8136 | 1 | 56 | 3567 | 0 | 0 | (0,1) | = 3 | 2050 | 24 | | | =5Cx0100000027466972= 737420726f7720496e7365727465640091026187eef30200 2 | 8080 | 1 | 56 | 3568 | 0 | 0 | (0,2) | = 3 | 2050 | 24 | | | =5Cx0400000029466f75= 7274682020726f77496e736572746564f4076187eef30200 (2 rows) SELECT * FROM One_Page_Wonder ; id | text | time_stamp ----+--------------------+---------------------------- 1 | First row Inserted | 2026-05-03 20:35:52.469137 (1 row) DROP TABLE One_Page_Wonder; DROP TABLE DROP EXTENSION pageinspect; DROP EXTENSION Freundliche Gr=FC=DFe i. A. Ramachandran Subramanian Zentralbereich Informationstechnologie Alte Leipziger Lebensversicherung a.G. Hallesche Krankenversicherung a.G. Alte Leipziger Lebensversicherung a.G., Alte Leipziger-Platz 1, 61440 Obe= rursel Vors. des Aufsichtsrats: Dr. Walter Botermann =B7 Vorstand: Christoph Boh= n (Vors.), Dr. J=FCrgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Joche= n Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcs= ek Sitz Oberursel (Taunus) =B7 Rechtsform VVaG =B7 Amtsgericht Bad Homburg v= . d. H. HRB 1583 =B7 USt.-IdNr. DE 114106814 =20 Hallesche Krankenversicherung a.G., L=F6ffelstra=DFe 34-38, 70597 Stuttg= art Vors. des Aufsichtsrats: Dr. Walter Botermann =B7 Vorstand: Christoph Boh= n (Vors.), Dr. J=FCrgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Joche= n Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek Sitz Stuttgart =B7 Rechtsform VVaG =B7 Amtsgericht Stuttgart HRB 2686 = =B7 USt.-IdNr. DE 147802285 Beitr=E4ge zu privaten Kranken- und Pflegekrankenversicherungen unterlieg= en nicht der Versicherungsteuer (=A7 4 Nr. 5 VersStG) =B7 Versicherungsle= istungen sowie Ums=E4tze aus Versicherungsvertreter-/Maklert=E4tigkeiten = sind umsatzsteuerfrei =20 =20 Die Pflichtangaben der ALH Gruppe gem=E4=DF =A7 35a GmbHG bzw. =A7 80 Akt= G finden Sie hier: https://www.alte-leipziger.de/impressum=20 ______________________ ALH Gruppe Alte Leipziger-Platz 1, 61440 Oberursel Tel.: +49 (6171) 66-4882 Fax: +49 (6171) 66-800-4882 E-Mail: ramachandran.subramanian@alte-leipziger.de www.alte-leipziger.de www.hallesche.de --_000_0f8e5544ae8a412bb637fcc3d15f8aaaalteleipzigerde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello,

 

 

 

I created a table called One_Page_Wonder and i= nserted 3 rows in it.  I updated row 2 and row 3 . I looked at the t= uples.

 

Row 1 is pristine, Row 2 and 3 have t_xmin and= t_xmax values to show the updates and older version of the tuples. So fa= r no confusion.

 

 

 

 

Then I truncated the table and inserted 1st ro= w and comitted it and inserted 4th row  and rolled it back.

 

The tuple for 4th row that I rolled back looks= identical to the 1st row that I commited !!!!

 

If I did not do a SELECT on One_Page_Wonder an= d just looked at the raw page, I would have concluded that both the tuple= s are valid and active and comitted.

 

How does postgres know that this 4th tuple has= been rolled back =3F  Please help me learn that.

 

 

Regards

 

Ram

 

 

 

 

SELECT * FROM heap_page_items(get_raw_page(= =27One_Page_Wonder=27,0));

lp | lp_off | lp_flags | lp_len | t_xmin | t_x= max | t_field3 | t_ctid | t_infomask2 | t_infomask | t_hoff | t_bits | t_= oid |           &n= bsp;           &nb= sp;       t_data

----+--------+----------+--------&= #43;--------+--------+----------+--------+-------------&#= 43;------------+--------+--------+-------+---------------= -----------------------------------------------------

  1 |   8136 |   = ;     1 |     56 |   35= 61 |      0 |      = ;  0 | (0,1)  |        =    3 |       2050 |  &n= bsp;  24 |        |  &n= bsp;    | =5Cx0100000027466972737420726f7720496e7365727465= 64008abd6087eef30200

  2 |   8080 |   = ;     1 |     56 |   35= 62 |   3565 |        0 | (0,= 5)  |       16387 |   &= nbsp;    258 |     24 |  &nb= sp;     |       | =5Cx0= 2000000275365636f6e6420726f77496e736572746564000fc66087eef30200

  3 |   8024 |   = ;     1 |     56 |   35= 63 |   3564 |        0 | (0,= 4)  |       16387 |   &= nbsp;    258 |     24 |  &nb= sp;     |       | =5Cx0= 30000002754686972642020726f77496e73657274656400cecb6087eef30200

  4 |   7968 |   = ;     1 |     56 |   35= 64 |      0 |      = ;  0 | (0,4)  |       32771 |&nbs= p;     10242 |     24 | &nbs= p;      |       | = =5Cx0300000021557064617465645f3372645f726f7700000000cecb6087eef30200=

  5 |   7912 |   = ;     1 |     56 |   35= 65 |      0 |      = ;  0 | (0,5)  |       32771 |&nbs= p;     10242 |     24 | &nbs= p;      |       | = =5Cx0200000021557064617465645f3272645f726f77000000000fc66087eef30200=

(5 rows)

 

SELECT * FROM One_Page_Wonder ;

id |       = text        |    =      time_stamp

----+--------------------+------------= ----------------

  1 | First row Inserted | 2026-05-03 20:= 35:52.451466

  3 | Updated_3rd_row    |= 2026-05-03 20:35:52.455118

  2 | Updated_2rd_row    |= 2026-05-03 20:35:52.453647

(3 rows)

 

TRUNCATE TABLE One_Page_Wonder;

TRUNCATE TABLE

INSERT INTO One_Page_Wonder<= /p>

(Id,Text)

VALUES

(1, =27First row Inserted=27);

INSERT 0 1

 

 

BEGIN;

BEGIN

SELECT pg_current_xact_id();=

pg_current_xact_id

--------------------

       &nbs= p;       3568

(1 row)

 

INSERT INTO One_Page_Wonder<= /p>

(Id,Text)

VALUES

(4, =27Fourth  rowInserted=27);

INSERT 0 1

ROLLBACK;

ROLLBACK

SELECT * FROM heap_page_items(get_raw_page(= =27One_Page_Wonder=27,0));

lp | lp_off | lp_flags | lp_len | t_xmin | t_x= max | t_field3 | t_ctid | t_infomask2 | t_infomask | t_hoff | t_bits | t_= oid |           &n= bsp;           &nb= sp;       t_data

----+--------+----------+--------&= #43;--------+--------+----------+--------+-------------&#= 43;------------+--------+--------+-------+---------------= -----------------------------------------------------

  1 |   8136 |   = ;     1 |     56 |   35= 67 |      0 |      = ;  0 | (0,1)  |        =    3 |       2050 |  &n= bsp;  24 |        |  &n= bsp;    | =5Cx0100000027466972737420726f7720496e7365727465= 640091026187eef30200

  2 |   8080 |   = ;     1 |     56 |   35= 68 |      0 |      = ;  0 | (0,2)  |        =    3 |       2050 |  &n= bsp;  24 |        |  &n= bsp;    | =5Cx0400000029466f757274682020726f77496e73657274= 6564f4076187eef30200

(2 rows)

 

SELECT * FROM One_Page_Wonder ;

id |       = text        |    =      time_stamp

----+--------------------+------------= ----------------

  1 | First row Inserted | 2026-05-03 20:= 35:52.469137

(1 row)

 

DROP TABLE One_Page_Wonder;<= /p>

DROP TABLE

DROP EXTENSION pageinspect;<= /p>

DROP EXTENSION


Freundliche Gr=FC=DFe


i. A. Ramachandran Subrama= nian =20

Zentralbereich Informationst= echnologie

=20

Alte Leipziger Lebensversicherung a. G.<= /SPAN>

Hallesche Krankenversicherung a. G.

=20

______________________

ALH Gruppe
Alte Leipziger-Platz 1, 614= 40 Oberursel
Tel: +49 (6171) 66-4882
Fax: +49 (6171) 66-800-4882E-Mail: ramachandran.subramanian@alte-leipziger.de
www.alte-leipziger.de
www.hallesche.de

Alte Leipziger Lebensversich= erung a. G., Alte Leipziger-Platz 1, 61440 Oberursel

Vors. des Aufsichtsra= ts: Dr. Walter Botermann =B7 Vorstand: Christoph Bohn (Vors.), Dr. J=FCrg= en Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexand= er Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek

Sitz Oberursel (Taunus) =B7 = Rechtsform VVaG =B7 Amtsgericht Bad Homburg v. d. H. HRB 1583 =B7 USt.-Id= Nr. DE 114106814


Hallesche Krankenversicherun= g a. G., L=F6ffelstra=DFe 34-38, 70597 Stuttgart

Vors. des Aufsichtsrats: Dr.= Walter Botermann =B7 Vorstand: Christoph Bohn (Vors.), Dr. J=FCrgen Bier= baum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Maye= r, Christian Pape, Wiltrud Pekarek, Udo Wilcsek

Sitz Stuttgart =B7 Rechtsfor= m VVaG =B7 Amtsgericht Stuttgart HRB 2686 =B7 USt.-IdNr. DE 147802285

Beitr=E4ge zu privaten Krank= en- und Pflegekrankenversicherungen unterliegen nicht der Versicherungste= uer (=A7 4 (1) Nr. 5 b VersStG) =B7 Versicherungsleistungen sowie Ums=E4t= ze aus Versicherungsvertreter-/Maklert=E4tigkeiten sind umsatzsteuerfrei<= /SPAN>


= Pflichtangaben der A= LH Gruppe gem=E4=DF =A7 35a GmbHG bzw. =A7 80 AktG --_000_0f8e5544ae8a412bb637fcc3d15f8aaaalteleipzigerde_--