From: Alvaro Herrera Date: Thu, 28 Jan 2021 15:50:40 +0000 (-0300) Subject: pgbench: Remove dead code X-Git-Tag: REL_10_16~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be2729dfaac3411ad34bd5dfce27b9228b3730d0;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index d1f091a65cd..13b472e3610 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -4164,14 +4164,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) { /*