diff --git a/HISTORY b/HISTORY index 48401be4..1818ccfe 100644 --- a/HISTORY +++ b/HISTORY @@ -35,3 +35,10 @@ Add --ignore-rsync-warning (Cédric) Add strnlen for compatibility with OS X (Greg) Improve performance of the repl_status view (Jaime) + +1.2.0 2012-06-15 + Test ssh connection before trying to rsync (Cédric) + Add CLUSTER SHOW command (Carlo Ascani) + Add CLUSTER CLEANUP command (Jaime) + Add function write_primary_conninfo (Marco Nenciarini) + Teach repmgr how to get tablespace's location in different pg version (Jaime Casanova) diff --git a/repmgr.c b/repmgr.c index 5ba74db2..9d3edb6a 100644 --- a/repmgr.c +++ b/repmgr.c @@ -790,11 +790,18 @@ do_standby_clone(void) * Check if the tablespace locations exists and that we can write to * them. */ - sqlquery_snprintf(sqlquery, - "SELECT spclocation " - " FROM pg_tablespace " - "WHERE spcname NOT IN ('pg_default', 'pg_global')"); - log_debug(_("standby clone: %s\n"), sqlquery); + if (strcmp(master_version, "9.0") == 0 || strcmp(master_version, "9.1") == 0) + sqlquery_snprintf(sqlquery, + "SELECT spclocation " + " FROM pg_tablespace " + "WHERE spcname NOT IN ('pg_default', 'pg_global')"); + else + sqlquery_snprintf(sqlquery, + "SELECT pg_tablespace_location(oid) spclocation " + " FROM pg_tablespace " + "WHERE spcname NOT IN ('pg_default', 'pg_global')"); + + log_debug("standby clone: %s\n", sqlquery); res = PQexec(conn, sqlquery); if (PQresultStatus(res) != PGRES_TUPLES_OK) @@ -1009,11 +1016,19 @@ do_standby_clone(void) * XXX We may not do that if we are in test_mode but it does not hurt too much * (except if a tablespace is created during the test) */ - sqlquery_snprintf(sqlquery, - "SELECT spclocation " - " FROM pg_tablespace " - " WHERE spcname NOT IN ('pg_default', 'pg_global')"); - log_debug(_("standby clone: %s\n"), sqlquery); + if (strcmp(master_version, "9.0") == 0 || strcmp(master_version, "9.1") == 0) + sqlquery_snprintf(sqlquery, + "SELECT spclocation " + " FROM pg_tablespace " + " WHERE spcname NOT IN ('pg_default', 'pg_global')"); + else + sqlquery_snprintf(sqlquery, + "SELECT pg_tablespace_location(oid) spclocation " + " FROM pg_tablespace " + " WHERE spcname NOT IN ('pg_default', 'pg_global')"); + + log_debug("standby clone: %s\n", sqlquery); + res = PQexec(conn, sqlquery); if (PQresultStatus(res) != PGRES_TUPLES_OK) {