Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b7a9e3c

Browse files
committed
make psql honor explicit database parameter in -l mode, in case "postgres" database is missing - per complaint from Philip Yarra.
1 parent cecb607 commit b7a9e3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/psql/startup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.126 2005/10/27 13:34:47 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.127 2005/11/17 23:42:26 adunstan Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -206,7 +206,8 @@ main(int argc, char *argv[])
206206
{
207207
need_pass = false;
208208
pset.db = PQsetdbLogin(options.host, options.port, NULL, NULL,
209-
options.action == ACT_LIST_DB ? "postgres" : options.dbname,
209+
options.action == ACT_LIST_DB && options.dbname == NULL ?
210+
"postgres" : options.dbname,
210211
username, password);
211212

212213
if (PQstatus(pset.db) == CONNECTION_BAD &&

0 commit comments

Comments
 (0)