mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
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;
|
||||
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)
|
||||
dbname = PQdb(o_conn);
|
||||
if (!user)
|
||||
|
Loading…
Reference in New Issue
Block a user