mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Make sure all clients have the same understanding of default user name
and database. In particular, make script wrappers understand the PGDATABASE environment variable.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.280 2002/08/04 05:03:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.281 2002/08/10 16:57:31 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -480,16 +480,9 @@ main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Get the target database name */
|
||||
/* Get database name from command line */
|
||||
if (optind < argc)
|
||||
dbname = argv[optind];
|
||||
else
|
||||
dbname = getenv("PGDATABASE");
|
||||
if (!dbname)
|
||||
{
|
||||
write_msg(NULL, "no database name specified\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (dataOnly && schemaOnly)
|
||||
{
|
||||
@@ -588,7 +581,7 @@ main(int argc, char **argv)
|
||||
if (g_fout->remoteVersion < 70300)
|
||||
{
|
||||
if (g_fout->remoteVersion >= 70100)
|
||||
g_last_builtin_oid = findLastBuiltinOid_V71(dbname);
|
||||
g_last_builtin_oid = findLastBuiltinOid_V71(PQdb(((ArchiveHandle *)g_conn)->connection));
|
||||
else
|
||||
g_last_builtin_oid = findLastBuiltinOid_V70();
|
||||
if (g_verbose)
|
||||
|
Reference in New Issue
Block a user