Content-Length: 263910 | pFad | http://github.com/postgrespro/postgres/commit/fe21fcaf8d91a71c15ff25276f9fa81e0cd1dba9

7A In psql, if the is no connection object, e.g. due to a server crash, · postgrespro/postgres@fe21fca · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/fe21fcaf8d91a71c15ff25276f9fa81e0cd1dba9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy