Fix reversed condition
authorTom Hughes <tom@compton.nu>
Wed, 22 Aug 2012 08:56:53 +0000 (09:56 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 22 Aug 2012 08:56:53 +0000 (09:56 +0100)
src/postgres.c

index 1faede6..f98f6b2 100644 (file)
@@ -47,7 +47,7 @@ db_execute(const char *statement, ExecStatusType expected)
     const char *sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE);
     ERROR("Failure executing PostgreSQL statement: %s: %s",
           sqlstate, PQresultErrorMessage(result));
-    if (strcmp(sqlstate, "57P01") != 0) {
+    if (strcmp(sqlstate, "57P01") == 0) {
       INFO("Resetting connection to PostgreSQL server");
       PQclear(result);
       PQreset(handle);