agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove duplicate definition of the compressed varlena header
Date: Fri, 25 Sep 2026 05:40:25 +0000
Message-ID: <E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org> (raw)

Remove duplicate definition of the compressed varlena header

toast_internals.h described the header of a compressed-in-line varlena
a second time, as toast_compress_header, with its own TOAST_COMPRESS_*
macros to read and write the tcinfo word.  varatt.h already describes
the same bytes as varattrib_4b.va_compressed and provides equivalent
macros that act as setter and getter of this information, as of
VARDATA_COMPRESSED_GET_EXTSIZE() and GET_COMPRESS_METHOD().

Let's remove the duplicate definition, and switch the TOAST code to use
the macros from varatt.h.  There should be no behavior change.

Note that toast_compression.h is removed from toast_internals.h, added
to the C files where its declarations are required.

Author: Nikhil Kumar Veldanda <veldanda.nikhilkumar17@gmail.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAFAfj_FeJQZrKyVn7ur0aJx8iz8SR14NheVJNyc8JNoqtMX+og@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e27f3b2cad7759097407ad01ccaaca506179e346

Modified Files
--------------
contrib/amcheck/verify_heapam.c             |  1 +
src/backend/access/brin/brin_tuple.c        |  1 +
src/backend/access/common/detoast.c         |  7 ++++---
src/backend/access/common/toast_internals.c |  3 ++-
src/include/access/toast_internals.h        | 29 -----------------------------
src/include/varatt.h                        | 15 +++++++++++++++
src/tools/pgindent/typedefs.list            |  1 -
7 files changed, 23 insertions(+), 34 deletions(-)



Message-ID: <E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org>
Permalink:  ../E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org

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-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove duplicate definition of the compressed varlena header
  In-Reply-To: <E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org>

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

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