1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add 'output file' option for pg_dumpall, especially useful for Win32,

where output redirection of child processes (pg_dump) doesn't work.

Dave Page
This commit is contained in:
Bruce Momjian
2007-01-25 03:30:43 +00:00
parent 1b7d863f1d
commit 6441288ec9
7 changed files with 155 additions and 60 deletions

View File

@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.458 2007/01/23 17:54:50 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.459 2007/01/25 03:30:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -478,25 +478,31 @@ main(int argc, char **argv)
/* open the output file */
switch (format[0])
{
case 'a':
case 'A':
plainText = 1;
g_fout = CreateArchive(filename, archNull, 0, archModeAppend);
break;
case 'c':
case 'C':
g_fout = CreateArchive(filename, archCustom, compressLevel);
g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite);
break;
case 'f':
case 'F':
g_fout = CreateArchive(filename, archFiles, compressLevel);
g_fout = CreateArchive(filename, archFiles, compressLevel, archModeWrite);
break;
case 'p':
case 'P':
plainText = 1;
g_fout = CreateArchive(filename, archNull, 0);
g_fout = CreateArchive(filename, archNull, 0, archModeWrite);
break;
case 't':
case 'T':
g_fout = CreateArchive(filename, archTar, compressLevel);
g_fout = CreateArchive(filename, archTar, compressLevel, archModeWrite);
break;
default: