]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
pgbench: Remove dead code
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Jan 2021 15:50:40 +0000 (12:50 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Jan 2021 15:50:40 +0000 (12:50 -0300)
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

index 875b764fa9e75fd4d2b33d7e4314e5b29c5cb96c..566593cde669835b345419d6653f6ba6e28621bf 100644 (file)
@@ -3310,14 +3310,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 (ttype != 3)
        {
                /*