mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Always use catalog path when calling system functions
Removes any risk of issues due to search path mangling etc.
This commit is contained in:
10
dbutils.c
10
dbutils.c
@@ -189,7 +189,7 @@ is_standby(PGconn *conn)
|
||||
PGresult *res;
|
||||
int result = 0;
|
||||
|
||||
res = PQexec(conn, "SELECT pg_is_in_recovery()");
|
||||
res = PQexec(conn, "SELECT pg_catalog.pg_is_in_recovery()");
|
||||
|
||||
if (res == NULL || PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ get_cluster_size(PGconn *conn, char *size)
|
||||
|
||||
sqlquery_snprintf(
|
||||
sqlquery,
|
||||
"SELECT pg_size_pretty(SUM(pg_database_size(oid))::bigint) "
|
||||
"SELECT pg_catalog.pg_size_pretty(SUM(pg_catalog.pg_database_size(oid))::bigint) "
|
||||
" FROM pg_database ");
|
||||
|
||||
res = PQexec(conn, sqlquery);
|
||||
@@ -618,7 +618,7 @@ get_master_connection(PGconn *standby_conn, char *cluster,
|
||||
* function closes the connection passed and exits. This still needs
|
||||
* to close master_conn first.
|
||||
*/
|
||||
res2 = PQexec(master_conn, "SELECT pg_is_in_recovery()");
|
||||
res2 = PQexec(master_conn, "SELECT pg_catalog.pg_is_in_recovery()");
|
||||
|
||||
if (PQresultStatus(res2) != PGRES_TUPLES_OK)
|
||||
{
|
||||
@@ -871,7 +871,7 @@ start_backup(PGconn *conn, char *first_wal_segment, bool fast_checkpoint)
|
||||
PGresult *res;
|
||||
|
||||
sqlquery_snprintf(sqlquery,
|
||||
"SELECT pg_xlogfile_name(pg_start_backup('repmgr_standby_clone_%ld', %s))",
|
||||
"SELECT pg_catalog.pg_xlogfile_name(pg_catalog.pg_start_backup('repmgr_standby_clone_%ld', %s))",
|
||||
time(NULL),
|
||||
fast_checkpoint ? "TRUE" : "FALSE");
|
||||
|
||||
@@ -906,7 +906,7 @@ stop_backup(PGconn *conn, char *last_wal_segment)
|
||||
char sqlquery[QUERY_STR_LEN];
|
||||
PGresult *res;
|
||||
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_xlogfile_name(pg_stop_backup())");
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_catalog.pg_xlogfile_name(pg_catalog.pg_stop_backup())");
|
||||
|
||||
res = PQexec(conn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
|
||||
@@ -1014,7 +1014,7 @@ standby_monitor(void)
|
||||
|
||||
|
||||
/* Get master xlog info */
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_current_xlog_location()");
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_catalog.pg_current_xlog_location()");
|
||||
|
||||
res = PQexec(master_conn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
@@ -1234,7 +1234,7 @@ do_master_failover(void)
|
||||
terminate(ERR_FAILOVER_FAIL);
|
||||
}
|
||||
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_catalog.pg_last_xlog_receive_location()");
|
||||
res = PQexec(node_conn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
@@ -1266,7 +1266,7 @@ do_master_failover(void)
|
||||
}
|
||||
|
||||
/* last we get info about this node, and update shared memory */
|
||||
sprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
||||
sprintf(sqlquery, "SELECT pg_catalog.pg_last_xlog_receive_location()");
|
||||
res = PQexec(my_local_conn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user