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:
Ian Barwick
2017-11-14 19:30:25 +09:00
parent 2a898721c0
commit d459b92186
6 changed files with 46 additions and 3 deletions

View File

@@ -4970,6 +4970,17 @@ write_primary_conninfo(char *line, t_conninfo_param_list *param_list)
}
}
/* passfile provided as configuration option */
if (config_file_options.passfile[0] != '\n')
{
/* check if the libpq we're using supports "passfile=" */
if (has_passfile() == true)
{
appendPQExpBuffer(&conninfo_buf, " passfile=");
appendConnStrVal(&conninfo_buf, config_file_options.passfile);
}
}
escaped = escape_recovery_conf_value(conninfo_buf.data);
maxlen_snprintf(line, "primary_conninfo = '%s'\n", escaped);