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 1be1ad3d6d9596839d98f7c3bd2e3643753e49ae..a4a3f40048e829e4091201a2c9eab053ca756a93 100644 (file)
@@ -6040,13 +6040,6 @@ main(int argc, char **argv)
    if (con == NULL)
        exit(1);
 
-   if (PQstatus(con) == CONNECTION_BAD)
-   {
-       pg_log_fatal("connection to database \"%s\" failed: %s",
-                    dbName, PQerrorMessage(con));
-       exit(1);
-   }
-
    if (internal_script_used)
        GetTableInfo(con, scale_given);