Skip to content

Commit edcedcc

Browse files
committed
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
1 parent d5a9d86 commit edcedcc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/bin/pg_dump/t/001_basic.pl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,22 @@
125125
qr/\Qpg_dump: error: -Z\/--compress must be in range 0..9\E/,
126126
'pg_dump: -Z/--compress must be in range');
127127

128+
if (check_pg_config("#define HAVE_LIBZ 1"))
129+
{
130+
command_fails_like(
131+
[ 'pg_dump', '--compress', '1', '--format', 'tar' ],
132+
qr/\Qpg_dump: error: compression is not supported by tar archive format\E/,
133+
'pg_dump: compression is not supported by tar archive format');
134+
}
135+
else
136+
{
137+
# --jobs > 1 forces an error with tar format.
138+
command_fails_like(
139+
[ 'pg_dump', '--compress', '1', '--format', 'tar', '-j3' ],
140+
qr/\Qpg_dump: warning: requested compression not available in this installation -- archive will be uncompressed\E/,
141+
'pg_dump: warning: compression not available in this installation');
142+
}
143+
128144
command_fails_like(
129145
[ 'pg_dump', '--extra-float-digits', '-16' ],
130146
qr/\Qpg_dump: error: --extra-float-digits must be in range\E/,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy