Split regression tests for TOAST compression methods into two files
authorMichael Paquier <michael@paquier.xyz>
Thu, 17 Jul 2025 05:08:55 +0000 (14:08 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 17 Jul 2025 05:08:55 +0000 (14:08 +0900)
commit74a3fc36f3141677a94d1f6fbfaee4cb3896a35a
tree7bd2aecf4b636eb937e0778bc5afcc058fa00250
parenta493e741d32b7580abe4d0dcc444fcedd8feec6e
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.nikhilkumar17@gmail.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: http://postgr.es/m/aDlcU-ym9KfMj9sG@paquier.xyz
src/test/regress/expected/compression.out
src/test/regress/expected/compression_1.out [deleted file]
src/test/regress/expected/compression_lz4.out [new file with mode: 0644]
src/test/regress/expected/compression_lz4_1.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/compression.sql
src/test/regress/sql/compression_lz4.sql [new file with mode: 0644]