diff --git a/src/backup.c b/src/backup.c index 9a451e72a..440c5a44f 100644 --- a/src/backup.c +++ b/src/backup.c @@ -2270,6 +2270,7 @@ check_external_for_tablespaces(parray *external_list, PGconn *backup_conn) PGresult *res; int i = 0; int j = 0; + int ntups; char *tablespace_path = NULL; char *query = "SELECT pg_catalog.pg_tablespace_location(oid) " "FROM pg_catalog.pg_tablespace " @@ -2281,7 +2282,8 @@ check_external_for_tablespaces(parray *external_list, PGconn *backup_conn) if (!res) elog(ERROR, "Failed to get list of tablespaces"); - for (i = 0; i < res->ntups; i++) + ntups = PQntuples(res); + for (i = 0; i < ntups; i++) { tablespace_path = PQgetvalue(res, i, 0); Assert (strlen(tablespace_path) > 0); diff --git a/src/catchup.c b/src/catchup.c index 79e3361a8..ce0651cc6 100644 --- a/src/catchup.c +++ b/src/catchup.c @@ -238,6 +238,7 @@ catchup_check_tablespaces_existance_in_tbsmapping(PGconn *conn) { PGresult *res; int i; + int ntups; char *tablespace_path = NULL; const char *linked_path = NULL; char *query = "SELECT pg_catalog.pg_tablespace_location(oid) " @@ -249,7 +250,8 @@ catchup_check_tablespaces_existance_in_tbsmapping(PGconn *conn) if (!res) elog(ERROR, "Failed to get list of tablespaces"); - for (i = 0; i < res->ntups; i++) + ntups = PQntuples(res); + for (i = 0; i < ntups; i++) { tablespace_path = PQgetvalue(res, i, 0); Assert (strlen(tablespace_path) > 0); diff --git a/src/pg_probackup.h b/src/pg_probackup.h index e583d7745..eaa512a92 100644 --- a/src/pg_probackup.h +++ b/src/pg_probackup.h @@ -13,7 +13,6 @@ #include "postgres_fe.h" #include "libpq-fe.h" -#include "libpq-int.h" #include "access/xlog_internal.h" #include "utils/pg_crc.h" diff --git a/src/utils/file.c b/src/utils/file.c index 7103c8f1d..706a90d05 100644 --- a/src/utils/file.c +++ b/src/utils/file.c @@ -4,6 +4,7 @@ #include "pg_probackup.h" /* sys/stat.h must be included after pg_probackup.h (see problems with compilation for windows described in PGPRO-5750) */ #include +#include #include "file.h" #include "storage/checksum.h"