mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04: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
1 changed files with 6 additions and 0 deletions
|
|
@ -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 a new issue