From 3055e8d0f1e79ac6487c7421e70dd987aca4c4cf Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 28 Jan 2021 12:50:40 -0300 Subject: [PATCH] pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/20210126195224.GA20361@alvherre.pgsql Reviewed-by: Tom Lane --- src/bin/pgbench/pgbench.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index e28726ef1f..bc07d3e5dd 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -5408,14 +5408,6 @@ main(int argc, char **argv) if (con == NULL) exit(1); - if (PQstatus(con) == CONNECTION_BAD) - { - fprintf(stderr, "connection to database \"%s\" failed\n", - PQdb(con) ? PQdb(con) : ""); - fprintf(stderr, "%s", PQerrorMessage(con)); - exit(1); - } - if (internal_script_used) { /*