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 22
22
*
23
23
*
24
24
* 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 $
26
26
*
27
27
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
28
28
*
@@ -948,6 +948,19 @@ main(int argc, char **argv)
948
948
exit (1 );
949
949
}
950
950
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
+
951
964
if (dataOnly && schemaOnly )
952
965
{
953
966
fprintf (stderr ,
@@ -1022,8 +1035,6 @@ main(int argc, char **argv)
1022
1035
/* Let the archiver know how noisy to be */
1023
1036
g_fout -> verbose = g_verbose ;
1024
1037
1025
- dbname = argv [optind ];
1026
-
1027
1038
/*
1028
1039
* Open the database using the Archiver, so it knows about it. Errors
1029
1040
* mean death
You can’t perform that action at this time.
0 commit comments