Commit 23fe7a74 authored by Tom Lane's avatar Tom Lane

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.
parent 84bbe57d
...@@ -528,20 +528,14 @@ main(int argc, char **argv) ...@@ -528,20 +528,14 @@ main(int argc, char **argv)
exit(1); exit(1);
} }
/* Identify archive format to emit */
archiveFormat = parseArchiveFormat(format, &archiveMode); archiveFormat = parseArchiveFormat(format, &archiveMode);
/* archiveFormat specific setup */ /* archiveFormat specific setup */
if (archiveFormat == archNull) if (archiveFormat == archNull)
plainText = 1; plainText = 1;
/* /* Custom and directory formats are compressed by default, others not */
* Ignore compression level for plain format. XXX: This is a bit
* inconsistent, tar-format throws an error instead.
*/
if (archiveFormat == archNull)
compressLevel = 0;
/* Custom and directory formats are compressed by default */
if (compressLevel == -1) if (compressLevel == -1)
{ {
if (archiveFormat == archCustom || archiveFormat == archDirectory) if (archiveFormat == archCustom || archiveFormat == archDirectory)
...@@ -550,7 +544,7 @@ main(int argc, char **argv) ...@@ -550,7 +544,7 @@ main(int argc, char **argv)
compressLevel = 0; compressLevel = 0;
} }
/* open the output file */ /* Open the output file */
g_fout = CreateArchive(filename, archiveFormat, compressLevel, archiveMode); g_fout = CreateArchive(filename, archiveFormat, compressLevel, archiveMode);
if (g_fout == NULL) if (g_fout == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment