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

Lines changed: 6 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy