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:
Bruce Momjian 2012-08-15 19:04:52 -04:00
parent 4c5316931f
commit fe21fcaf8d

View File

@ -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)