diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2005-11-17 23:49:44 +0000 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2005-11-17 23:49:44 +0000 |
commit | eed9eb446a56ba8ea6b2a09994896c91f86e08d7 (patch) | |
tree | 9998755b9403a1e9f934fb9e0daa6360bf571d83 /src | |
parent | be324ad2ab2af9703ba9731d56ce2a005ff48da3 (diff) | |
download | postgresql-eed9eb446a56ba8ea6b2a09994896c91f86e08d7.tar.gz postgresql-eed9eb446a56ba8ea6b2a09994896c91f86e08d7.zip |
make psql honor explicit database parameter in -l mode, in case "postgres" database is missing - per complaint from Philip Yarra.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/startup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 783a472aec8..7c374db77c9 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.126 2005/10/27 13:34:47 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.126.2.1 2005/11/17 23:49:44 adunstan Exp $ */ #include "postgres_fe.h" @@ -206,7 +206,8 @@ main(int argc, char *argv[]) { need_pass = false; pset.db = PQsetdbLogin(options.host, options.port, NULL, NULL, - options.action == ACT_LIST_DB ? "postgres" : options.dbname, + options.action == ACT_LIST_DB && options.dbname == NULL ? + "postgres" : options.dbname, username, password); if (PQstatus(pset.db) == CONNECTION_BAD && |