pgbench: Remove dead code
authorAlvaro Herrera <[email protected]>
Thu, 28 Jan 2021 15:50:40 +0000 (12:50 -0300)
committerAlvaro Herrera <[email protected]>
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[email protected]
Reviewed-by: Tom Lane <[email protected]>
src/bin/pgbench/pgbench.c

index 6ff0628c7bda65b5986c53469ea5951d4630147c..837dd24562b9f609ea0ecb59a709f934f61c5358 100644 (file)
@@ -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)
    {
        /*