postgresql/src
Michael Paquier a7885c9bb2 Provide test coverage in pg_dump for default behaviors with compression
By default, the contents generated by the custom and directory dump
formats are compressed.  However, with the existing test facility, the
restore program will succeed regardless of whether the dumped output was
compressed or not without checking if anything has been compressed.

This commit implements a portable way to check the contents of the
custom and directory dump formats:
- glob_patterns, that can be defined for each test as an array of
glob()-compilable strings, tracking the contents that should or should
not be compressed.  While this is useful to make sure that the table
data is compressed, this also checks that blobs.toc and toc.dat are
never compressed.
- command_like, to execute a command on a dump and check its generated
output.  This is used here in correlation with pg_restore -l to check if
the dumps have been compressed or not, depending on if the build
supports gzip, or not.

This hole in the tests has come up when working on 5e73a60, where
compression has to be applied by default, if available, for both dump
formats.

The idea of glob_patterns comes from me, and Georgios has come up with
the design for command_like.

Author: Georgios Kokolatos, Michael Paquier
Discussion: https://postgr.es/m/DQn4czCWR1rcbGPLL7p3LfEr5-kGmlySm-H05VgroINdikvhtS5r9EdI6b8D8sjnbKdJ09k-cxs2AqijBeHAWk9Q8gvEAxPRHuLRhwONcGc=@pm.me
2022-12-06 09:20:13 +09:00
..
backend Fix Memoize to work with partitionwise joining. 2022-12-05 12:36:40 -05:00
bin Provide test coverage in pg_dump for default behaviors with compression 2022-12-06 09:20:13 +09:00
common Refactor code parsing compression option values (-Z/--compress) 2022-11-30 09:34:32 +09:00
fe_utils meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
include Fix Memoize to work with partitionwise joining. 2022-12-05 12:36:40 -05:00
interfaces Fix comment in fe-auth-scram.c 2022-11-30 08:37:59 +09:00
makefiles autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
pl Allow building with MSVC and Strawberry perl 2022-11-25 15:28:38 -05:00
port autoconf: Unify CFLAGS_SSE42 and CFLAGS_ARMV8_CRC32C 2022-12-01 18:46:55 -08:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Fix Memoize to work with partitionwise joining. 2022-12-05 12:36:40 -05:00
timezone Remove unneeded includes of <sys/stat.h> 2022-11-05 12:31:28 +09:00
tools Switch pg_dump to use compression specifications 2022-12-02 10:45:02 +09:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in autoconf: Don't AC_SUBST() LD in configure 2022-12-01 19:03:26 -08:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00