improve the error case detection of slony_logshipper
authorSteve Singer <ssinger@ca.afilias.info>
Wed, 3 Jul 2013 20:50:42 +0000 (16:50 -0400)
committerSteve Singer <ssinger@ca.afilias.info>
Wed, 3 Jul 2013 20:50:42 +0000 (16:50 -0400)
This commit will give a better error message when the log shipper connects to
a databse without the sl_archive_tracking tables.

src/slony_logshipper/slony_logshipper.c

index be52c0095422c25aa574848b5933a6730626fac9..019f5e2975369b7ed63d7820c8d50126904a353e 100644 (file)
@@ -1287,7 +1287,7 @@ get_current_at_counter(void)
        slon_mkquery(&ds, "select at_counter from %s.sl_archive_tracking;",
                                 namespace);
        res = PQexec(dbconn, dstring_data(&ds));
-       if (PQresultStatus(res) != PGRES_TUPLES_OK)
+       if (PQresultStatus(res) != PGRES_TUPLES_OK || PQntuples(res)==0 )
        {
                errlog(LOG_ERROR, "cannot retrieve archive tracking status: %s\n",
                           PQresultErrorMessage(res));