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.
This commit is contained in:
parent
4c5316931f
commit
fe21fcaf8d
@ -1512,6 +1512,12 @@ do_connect(char *dbname, char *user, char *host, char *port)
|
|||||||
*n_conn;
|
*n_conn;
|
||||||
char *password = NULL;
|
char *password = NULL;
|
||||||
|
|
||||||
|
if (!o_conn && (!dbname || !user || !host || !port))
|
||||||
|
{
|
||||||
|
fputs(_("All connection parameters must be supplied because no database connection exists\n"), stderr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!dbname)
|
if (!dbname)
|
||||||
dbname = PQdb(o_conn);
|
dbname = PQdb(o_conn);
|
||||||
if (!user)
|
if (!user)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user