Skip to content

Commit 23fe7a7

Browse files
committed
Un-break compression of plain-text output format in pg_dump.
pg_dump has historically understood -Z with no -F switch to mean that it should emit a gzip-compressed version of its plain text output. This got broken through a misunderstanding in the 9.1 patch that added directory output format. Restore the former behavior. Per complaint from Roger Niederland and diagnosis by Adrian Klaver.
1 parent 84bbe57 commit 23fe7a7

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,20 +528,14 @@ main(int argc, char **argv)
528528
exit(1);
529529
}
530530

531+
/* Identify archive format to emit */
531532
archiveFormat = parseArchiveFormat(format, &archiveMode);
532533

533534
/* archiveFormat specific setup */
534535
if (archiveFormat == archNull)
535536
plainText = 1;
536537

537-
/*
538-
* Ignore compression level for plain format. XXX: This is a bit
539-
* inconsistent, tar-format throws an error instead.
540-
*/
541-
if (archiveFormat == archNull)
542-
compressLevel = 0;
543-
544-
/* Custom and directory formats are compressed by default */
538+
/* Custom and directory formats are compressed by default, others not */
545539
if (compressLevel == -1)
546540
{
547541
if (archiveFormat == archCustom || archiveFormat == archDirectory)
@@ -550,7 +544,7 @@ main(int argc, char **argv)
550544
compressLevel = 0;
551545
}
552546

553-
/* open the output file */
547+
/* Open the output file */
554548
g_fout = CreateArchive(filename, archiveFormat, compressLevel, archiveMode);
555549

556550
if (g_fout == NULL)

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