pgsql: Remove duplicate definition of the compressed varlena header

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove duplicate definition of the compressed varlena header
Date: 2026-09-25 05:40:25
Message-ID: E1x9yfZ-00000001AyH-3RmL@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)nikhilkumar17(at)gmail(dot)com>
Author: Michael Paquier <michael(at)paquier(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-09-25 06:02:43 pgsql: Declare variable-length catalog columns as [] rather than [1]
Previous Message Amit Langote 2026-09-25 01:00:23 pgsql: Fix missed pgindent in varlena.c