mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Use bdr.bdr_is_active_in_db() when checking for BDR presence
This commit is contained in:
25
dbutils.c
25
dbutils.c
@@ -2920,7 +2920,6 @@ get_last_wal_receive_location(PGconn *conn)
|
|||||||
/* BDR functions */
|
/* BDR functions */
|
||||||
/* ============= */
|
/* ============= */
|
||||||
|
|
||||||
/* possibly use bdr.bdr_is_active_in_db() ? */
|
|
||||||
bool
|
bool
|
||||||
is_bdr_db(PGconn *conn)
|
is_bdr_db(PGconn *conn)
|
||||||
{
|
{
|
||||||
@@ -2948,6 +2947,30 @@ is_bdr_db(PGconn *conn)
|
|||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
|
if (is_bdr_db == false)
|
||||||
|
{
|
||||||
|
log_warning(_("BDR extension is not available for this database"));
|
||||||
|
return is_bdr_db;
|
||||||
|
}
|
||||||
|
|
||||||
|
initPQExpBuffer(&query);
|
||||||
|
|
||||||
|
appendPQExpBuffer(
|
||||||
|
&query,
|
||||||
|
"SELECT bdr.bdr_is_active_in_db()");
|
||||||
|
res = PQexec(conn, query.data);
|
||||||
|
termPQExpBuffer(&query);
|
||||||
|
|
||||||
|
is_bdr_db = strcmp(PQgetvalue(res, 0, 0), "t") == 0 ? true : false;
|
||||||
|
|
||||||
|
if (is_bdr_db == false)
|
||||||
|
{
|
||||||
|
log_warning(_("BDR extension available for this database, but the database is not configured for BDR"));
|
||||||
|
|
||||||
|
}
|
||||||
|
PQclear(res);
|
||||||
|
|
||||||
|
|
||||||
return is_bdr_db;
|
return is_bdr_db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user