mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 16:16:29 +00:00
Add configuration file "passfile"
This will enable a custom .pgpass to be included in "primary_conninfo" (provided it's supported by the libpq version on the standby).
This commit is contained in:
29
dbutils.c
29
dbutils.c
@@ -594,7 +594,7 @@ parse_conninfo_string(const char *conninfo_str, t_conninfo_param_list *param_lis
|
||||
(option->val != NULL && option->val[0] == '\0'))
|
||||
continue;
|
||||
|
||||
/* Ignore application_name */
|
||||
/* Ignore settings specific to the upstream node */
|
||||
if (ignore_local_params == true)
|
||||
{
|
||||
if (strcmp(option->keyword, "application_name") == 0)
|
||||
@@ -678,6 +678,33 @@ param_list_to_string(t_conninfo_param_list *param_list)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* check whether the libpq version in use recognizes the "passfile" parameter
|
||||
* (should be 9.6 and later)
|
||||
*/
|
||||
bool
|
||||
has_passfile(void)
|
||||
{
|
||||
PQconninfoOption *defs = PQconndefaults();
|
||||
PQconninfoOption *def = NULL;
|
||||
bool has_passfile = false;
|
||||
|
||||
for (def = defs; def->keyword; def++)
|
||||
{
|
||||
if (strcmp(def->keyword, "passfile") == 0)
|
||||
{
|
||||
has_passfile = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PQconninfoFree(defs);
|
||||
|
||||
return has_passfile;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ===================== */
|
||||
/* transaction functions */
|
||||
/* ===================== */
|
||||
|
||||
Reference in New Issue
Block a user