postgres.git / summary / log / commit / refs
commit 4162f91d1c201f5f76c34910e35d32aeb673b219
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Thu Jan 28 15:50:40 2021 +0000
First released in: 14.0, 9.5.25, 9.6.21, 10.16, 11.11, 12.6, 13.2
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 <tgl@sss.pgh.pa.us>
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 6ff0628c7bd..837dd24562b 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3911,14 +3911,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)
{
/*
[parent: bcae842b962a]