diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-03-30 13:34:01 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-03-30 13:34:01 +0900 |
commit | edcedcc2c7bb8390858bbccda9637318598f2473 (patch) | |
tree | 92a4f55cb2119519ff01c7f62905cd3883159849 /src | |
parent | d5a9d86d8ffcadc52ff3729cd00fbd83bc38643c (diff) | |
download | postgresql-edcedcc2c7bb8390858bbccda9637318598f2473.tar.gz postgresql-edcedcc2c7bb8390858bbccda9637318598f2473.zip |
Add TAP test in pg_dump with --format=tar and --compress
This combination of options has never been supported, and it has never
been checked in the regression tests. When building the code without
zlib support, pg_dump is allowed to run and it generates a warning to
inform that any contents are dumped as uncompressed. The tests added by
this commit check both behaviors.
Author: Georgios Kokolatos, Rachel Heaton
Discussion: https://postgr.es/m/faUNEOpts9vunEaLnmxmG-DldLSg_ql137OC3JYDmgrOMHm1RvvWY2IdBkv_CRxm5spCCb_OmKNk2T03TMm0fBEWveFF9wA1WizPuAgB7Ss=@protonmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/t/001_basic.pl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl index e0bf3eb032a..65e6c01fed7 100644 --- a/src/bin/pg_dump/t/001_basic.pl +++ b/src/bin/pg_dump/t/001_basic.pl @@ -125,6 +125,22 @@ command_fails_like( qr/\Qpg_dump: error: -Z\/--compress must be in range 0..9\E/, 'pg_dump: -Z/--compress must be in range'); +if (check_pg_config("#define HAVE_LIBZ 1")) +{ + command_fails_like( + [ 'pg_dump', '--compress', '1', '--format', 'tar' ], + qr/\Qpg_dump: error: compression is not supported by tar archive format\E/, + 'pg_dump: compression is not supported by tar archive format'); +} +else +{ + # --jobs > 1 forces an error with tar format. + command_fails_like( + [ 'pg_dump', '--compress', '1', '--format', 'tar', '-j3' ], + qr/\Qpg_dump: warning: requested compression not available in this installation -- archive will be uncompressed\E/, + 'pg_dump: warning: compression not available in this installation'); +} + command_fails_like( [ 'pg_dump', '--extra-float-digits', '-16' ], qr/\Qpg_dump: error: --extra-float-digits must be in range\E/, |