mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
standby clone: don't error out if unable to determine cluster size
The cluster size check is purely informative, and is not in any way essential for the standby clone operation. As it's possible the query may fail if the repmgr user does not have sufficient privileges to query all databases in the cluster, we can simply ignore any failure. Note that the code comment indicated the query also served to sanity- check that queries can actually be executed. While this was the case historically, the preceding server version check now serves the same purpose and will not have the same risk of failure due to missing permissions.
This commit is contained in:
@@ -1291,21 +1291,16 @@ get_cluster_size(PGconn *conn, char *size)
|
||||
initPQExpBuffer(&query);
|
||||
appendPQExpBufferStr(&query,
|
||||
"SELECT pg_catalog.pg_size_pretty(pg_catalog.sum(pg_catalog.pg_database_size(oid))::bigint) "
|
||||
" FROM pg_catalog.pg_database ");
|
||||
" FROM pg_catalog.pg_database ");
|
||||
|
||||
log_verbose(LOG_DEBUG, "get_cluster_size():\n%s", query.data);
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
log_db_error(conn, query.data, _("get_cluster_size(): unable to execute query"));
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(size, MAXLEN, "%s", PQgetvalue(res, 0, 0));
|
||||
}
|
||||
|
||||
termPQExpBuffer(&query);
|
||||
PQclear(res);
|
||||
|
||||
Reference in New Issue
Block a user