mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Allow repmgr to obtain tablespace's locations from pg 9.2 and later
in which we no longer have a spclocation column in pg_tablespaces
This commit is contained in:
7
HISTORY
7
HISTORY
@@ -35,3 +35,10 @@
|
|||||||
Add --ignore-rsync-warning (Cédric)
|
Add --ignore-rsync-warning (Cédric)
|
||||||
Add strnlen for compatibility with OS X (Greg)
|
Add strnlen for compatibility with OS X (Greg)
|
||||||
Improve performance of the repl_status view (Jaime)
|
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)
|
||||||
|
|||||||
35
repmgr.c
35
repmgr.c
@@ -790,11 +790,18 @@ do_standby_clone(void)
|
|||||||
* Check if the tablespace locations exists and that we can write to
|
* Check if the tablespace locations exists and that we can write to
|
||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
sqlquery_snprintf(sqlquery,
|
if (strcmp(master_version, "9.0") == 0 || strcmp(master_version, "9.1") == 0)
|
||||||
"SELECT spclocation "
|
sqlquery_snprintf(sqlquery,
|
||||||
" FROM pg_tablespace "
|
"SELECT spclocation "
|
||||||
"WHERE spcname NOT IN ('pg_default', 'pg_global')");
|
" FROM pg_tablespace "
|
||||||
log_debug(_("standby clone: %s\n"), sqlquery);
|
"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);
|
res = PQexec(conn, sqlquery);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
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
|
* 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)
|
* (except if a tablespace is created during the test)
|
||||||
*/
|
*/
|
||||||
sqlquery_snprintf(sqlquery,
|
if (strcmp(master_version, "9.0") == 0 || strcmp(master_version, "9.1") == 0)
|
||||||
"SELECT spclocation "
|
sqlquery_snprintf(sqlquery,
|
||||||
" FROM pg_tablespace "
|
"SELECT spclocation "
|
||||||
" WHERE spcname NOT IN ('pg_default', 'pg_global')");
|
" FROM pg_tablespace "
|
||||||
log_debug(_("standby clone: %s\n"), sqlquery);
|
" 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);
|
res = PQexec(conn, sqlquery);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user