|
12 | 12 | *by PostgreSQL |
13 | 13 | * |
14 | 14 | * IDENTIFICATION |
15 | | - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.461 2007/03/19 23:38:30 wieck Exp $ |
| 15 | + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.462 2007/03/22 19:42:02 momjian Exp $ |
16 | 16 | * |
17 | 17 | *------------------------------------------------------------------------- |
18 | 18 | */ |
@@ -476,38 +476,33 @@ main(int argc, char **argv) |
476 | 476 | } |
477 | 477 |
|
478 | 478 | /* open the output file */ |
479 | | -switch (format[0]) |
| 479 | +if (strcasecmp(format,"a")==0||strcasecmp(format,"append")==0) |
480 | 480 | { |
481 | | -case'a': |
482 | | -case'A': |
483 | | -plainText=1; |
484 | | -g_fout=CreateArchive(filename,archNull,0,archModeAppend); |
485 | | -break; |
486 | | - |
487 | | -case'c': |
488 | | -case'C': |
489 | | -g_fout=CreateArchive(filename,archCustom,compressLevel,archModeWrite); |
490 | | -break; |
491 | | - |
492 | | -case'f': |
493 | | -case'F': |
494 | | -g_fout=CreateArchive(filename,archFiles,compressLevel,archModeWrite); |
495 | | -break; |
496 | | - |
497 | | -case'p': |
498 | | -case'P': |
499 | | -plainText=1; |
500 | | -g_fout=CreateArchive(filename,archNull,0,archModeWrite); |
501 | | -break; |
502 | | - |
503 | | -case't': |
504 | | -case'T': |
505 | | -g_fout=CreateArchive(filename,archTar,compressLevel,archModeWrite); |
506 | | -break; |
507 | | - |
508 | | -default: |
509 | | -write_msg(NULL,"invalid output format \"%s\" specified\n",format); |
510 | | -exit(1); |
| 481 | +/* not documented */ |
| 482 | +plainText=1; |
| 483 | +g_fout=CreateArchive(filename,archNull,0,archModeAppend); |
| 484 | +} |
| 485 | +elseif (strcasecmp(format,"c")==0||strcasecmp(format,"custom")==0) |
| 486 | +g_fout=CreateArchive(filename,archCustom,compressLevel,archModeWrite); |
| 487 | +elseif (strcasecmp(format,"f")==0||strcasecmp(format,"file")==0) |
| 488 | +{ |
| 489 | +/* |
| 490 | + *Dump files into the current directory; for demonstration only, not |
| 491 | + *documented. |
| 492 | + */ |
| 493 | +g_fout=CreateArchive(filename,archFiles,compressLevel,archModeWrite); |
| 494 | +} |
| 495 | +elseif (strcasecmp(format,"p")==0||strcasecmp(format,"plain")==0) |
| 496 | +{ |
| 497 | +plainText=1; |
| 498 | +g_fout=CreateArchive(filename,archNull,0,archModeWrite); |
| 499 | +} |
| 500 | +elseif (strcasecmp(format,"t")==0||strcasecmp(format,"tar")==0) |
| 501 | +g_fout=CreateArchive(filename,archTar,compressLevel,archModeWrite); |
| 502 | +else |
| 503 | +{ |
| 504 | +write_msg(NULL,"invalid output format \"%s\" specified\n",format); |
| 505 | +exit(1); |
511 | 506 | } |
512 | 507 |
|
513 | 508 | if (g_fout==NULL) |
|