mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 16:16:29 +00:00
Add function repmgr_get_primary_conninfo()
This commit is contained in:
15
repmgr.c
15
repmgr.c
@@ -2201,6 +2201,21 @@ create_schema(PGconn *conn)
|
||||
}
|
||||
PQclear(res);
|
||||
|
||||
sqlquery_snprintf(sqlquery,
|
||||
"CREATE OR REPLACE FUNCTION %s.repmgr_get_primary_conninfo() "
|
||||
" RETURNS text "
|
||||
" AS '$libdir/repmgr_funcs', 'repmgr_get_primary_conninfo' "
|
||||
" LANGUAGE C STRICT ",
|
||||
get_repmgr_schema_quoted(conn));
|
||||
|
||||
res = PQexec(conn, sqlquery);
|
||||
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||
{
|
||||
fprintf(stderr, "Cannot create the function repmgr_get_primary_conninfo: %s\n",
|
||||
PQerrorMessage(conn));
|
||||
return false;
|
||||
}
|
||||
PQclear(res);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user