aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2005-11-17 23:42:26 +0000
committerAndrew Dunstan <andrew@dunslane.net>2005-11-17 23:42:26 +0000
commitb7a9e3ceb4f48d810f310f0d468635310160b878 (patch)
tree62f5be8dab8d0e94bec34cb4af08a181e5d96afa /src
parentcecb6075594a407b7adcd9c9a0c243ca4b43c9a3 (diff)
downloadpostgresql-b7a9e3ceb4f48d810f310f0d468635310160b878.tar.gz
postgresql-b7a9e3ceb4f48d810f310f0d468635310160b878.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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 783a472aec8..c4d322691ea 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.127 2005/11/17 23:42:26 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 &&