summaryrefslogtreecommitdiff
path: root/src/bin/pgbench/pgbench.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pgbench/pgbench.c')
-rw-r--r--src/bin/pgbench/pgbench.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index b08121c905e..875b764fa9e 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -686,7 +686,7 @@ doConnect(void)
if (PQstatus(conn) == CONNECTION_BAD)
{
fprintf(stderr, "connection to database \"%s\" failed:\n%s",
- dbName, PQerrorMessage(conn));
+ PQdb(conn), PQerrorMessage(conn));
PQfinish(conn);
return NULL;
}
@@ -3312,7 +3312,8 @@ main(int argc, char **argv)
if (PQstatus(con) == CONNECTION_BAD)
{
- fprintf(stderr, "connection to database \"%s\" failed\n", dbName);
+ fprintf(stderr, "connection to database \"%s\" failed\n",
+ PQdb(con) ? PQdb(con) : "");
fprintf(stderr, "%s", PQerrorMessage(con));
exit(1);
}