1
0
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:
Peter Eisentraut
2002-08-10 16:57:32 +00:00
parent 60ac5b805e
commit 029aa97f2d
19 changed files with 74 additions and 161 deletions

View File

@@ -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)