From f507abd14336dc1fcc8a6aec9a43a3655fd49971 Mon Sep 17 00:00:00 2001 From: Steve Singer Date: Wed, 3 Jul 2013 16:50:42 -0400 Subject: [PATCH] improve the error case detection of slony_logshipper 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slony_logshipper/slony_logshipper.c b/src/slony_logshipper/slony_logshipper.c index be52c009..019f5e29 100644 --- a/src/slony_logshipper/slony_logshipper.c +++ b/src/slony_logshipper/slony_logshipper.c @@ -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)); -- 2.39.5