pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Provide test coverage in pg_dump for default behaviors with comp
Date: Tue, 06 Dec 2022 00:20:46 +0000
Message-ID: <E1p2LhV-002AGC-8f@gemulon.postgresql.org> (raw)

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-cxs2Aqij...

Branch
------
master

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

Modified Files
--------------
src/bin/pg_dump/t/002_pg_dump.pl | 77 ++++++++++++++++++++++++++++++++++++----
1 file changed, 71 insertions(+), 6 deletions(-)



Message-ID: <E1p2LhV-002AGC-8f@gemulon.postgresql.org>
Permalink:  ../E1p2LhV-002AGC-8f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p2LhV-002AGC-8f@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Provide test coverage in pg_dump for default behaviors with comp
  In-Reply-To: <E1p2LhV-002AGC-8f@gemulon.postgresql.org>
  References: <E1p2LhV-002AGC-8f@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox