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

Commit fe21fca

Browse files
committed
In psql, if the is no connection object, e.g. due to a server crash,
require all parameters for \c, rather than using the defaults, which might be wrong.
1 parent 4c53169 commit fe21fca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bin/psql/command.c

+6
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,12 @@ do_connect(char *dbname, char *user, char *host, char *port)
15121512
*n_conn;
15131513
char *password = NULL;
15141514

1515+
if (!o_conn && (!dbname || !user || !host || !port))
1516+
{
1517+
fputs(_("All connection parameters must be supplied because no database connection exists\n"), stderr);
1518+
return false;
1519+
}
1520+
15151521
if (!dbname)
15161522
dbname = PQdb(o_conn);
15171523
if (!user)

0 commit comments

Comments
 (0)