pgsql: Split regression tests for TOAST compression methods into two fi

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Split regression tests for TOAST compression methods into two fi
Date: 2025-07-17 05:11:18
Message-ID: E1ucGtq-006hev-2k@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Split regression tests for TOAST compression methods into two files

The regression tests for TOAST compression methods are split into two
independent files: one specific to LZ4 and interactions between two
different TOAST compression methods, now called compression_lz4, and a
second one for the "core" cases where only pglz is required.

This saves 300 lines in diffs coming from the alternate output of
compression.sql, required for builds where lz4 is not available. The
new test is skipped if the build does not support LZ4 compression,
relying on an \if and the values reported in pg_settings for the GUC
default_toast_compression, "lz4" being available only under USE_LZ4.

Another benefit of this split is that this facilitates the addition of
more compression methods for TOAST, which are under discussion.

Note the trick added for the tests of the GUC default_toast_compression,
where VERBOSITY = terse is used to avoid the HINT printing the lists of
values available in the GUC, which are environment-dependent. This
makes compression.sql independent of the availability of LZ4.

The code coverage of toast_compression.c is slightly improved, increased
from 89% to 91%, with one new case covered in lz4_compress_datum() for
incompressible data.

Author: Nikhil Kumar Veldanda <veldanda(dot)nikhilkumar17(at)gmail(dot)com>
Co-authored-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/aDlcU-ym9KfMj9sG@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/74a3fc36f3141677a94d1f6fbfaee4cb3896a35a

Modified Files
--------------
src/test/regress/expected/compression.out | 235 ++--------------
src/test/regress/expected/compression_1.out | 360 ------------------------
src/test/regress/expected/compression_lz4.out | 249 ++++++++++++++++
src/test/regress/expected/compression_lz4_1.out | 7 +
src/test/regress/parallel_schedule | 2 +-
src/test/regress/sql/compression.sql | 84 +-----
src/test/regress/sql/compression_lz4.sql | 129 +++++++++
7 files changed, 414 insertions(+), 652 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2025-07-17 05:31:58 pgsql: Remove duplicate line
Previous Message Tom Lane 2025-07-17 04:20:30 Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p