summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-09-25 13:59:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-09-25 13:59:35 -0400
commitbe64ba6230d697bca724f9c4aaa9f071164364d1 (patch)
treec29632a2c6bdeb5d904747c522d43c3772ec596f /src
parent3f75cecfbb419b733069dfde0d031fd24aa6e4e5 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dump.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f4465e7da73..9d0e3d671e3 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -528,20 +528,14 @@ main(int argc, char **argv)
exit(1);
}
+ /* Identify archive format to emit */
archiveFormat = parseArchiveFormat(format, &archiveMode);
/* archiveFormat specific setup */
if (archiveFormat == archNull)
plainText = 1;
- /*
- * 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 */
+ /* Custom and directory formats are compressed by default, others not */
if (compressLevel == -1)
{
if (archiveFormat == archCustom || archiveFormat == archDirectory)
@@ -550,7 +544,7 @@ main(int argc, char **argv)
compressLevel = 0;
}
- /* open the output file */
+ /* Open the output file */
g_fout = CreateArchive(filename, archiveFormat, compressLevel, archiveMode);
if (g_fout == NULL)