File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2222 *
2323 *
2424 * IDENTIFICATION
25- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.203 2001/04/22 21:34:13 tgl Exp $
25+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.204 2001/04/23 23:36:33 tgl Exp $
2626 *
2727 * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2828 *
@@ -948,6 +948,19 @@ main(int argc, char **argv)
948948 exit (1 );
949949 }
950950
951+ /* Get the target database name */
952+ if (optind < argc )
953+ dbname = argv [optind ];
954+ else
955+ dbname = getenv ("PGDATABASE" );
956+ if (!dbname )
957+ {
958+ fprintf (stderr ,
959+ "%s: no database name specified\n" ,
960+ progname );
961+ exit (1 );
962+ }
963+
951964 if (dataOnly && schemaOnly )
952965 {
953966 fprintf (stderr ,
@@ -1022,8 +1035,6 @@ main(int argc, char **argv)
10221035 /* Let the archiver know how noisy to be */
10231036 g_fout -> verbose = g_verbose ;
10241037
1025- dbname = argv [optind ];
1026-
10271038 /*
10281039 * Open the database using the Archiver, so it knows about it. Errors
10291040 * mean death
You can’t perform that action at this time.
0 commit comments