projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c53169
)
In psql, if the is no connection object, e.g. due to a server crash,
author
Bruce Momjian
Wed, 15 Aug 2012 23:04:52 +0000
(19:04 -0400)
committer
Bruce Momjian
Wed, 15 Aug 2012 23:05:05 +0000
(19:05 -0400)
require all parameters for \c, rather than using the defaults, which
might be wrong.
src/bin/psql/command.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/command.c
b/src/bin/psql/command.c
index 6ead800aeb1324c1078359dc00813ee8b5116fd7..2cd3ab4cf72d48691a04f2bb9333a58fadd8bfca 100644
(file)
--- a/
src/bin/psql/command.c
+++ b/
src/bin/psql/command.c
@@
-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)