mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
standby clone: improve Barman source server check
Use "remote_command()" to execute the remote psql command, and provide the -X option to psql to ensure it doesn't read ~/.psqlrc.
This commit is contained in:
@@ -5962,19 +5962,22 @@ check_source_server_via_barman()
|
|||||||
|
|
||||||
initPQExpBuffer(&command_output);
|
initPQExpBuffer(&command_output);
|
||||||
maxlen_snprintf(buf,
|
maxlen_snprintf(buf,
|
||||||
"ssh %s \"psql -Aqt \\\"%s\\\" -c \\\""
|
"psql -AqtX -d \\\"%s\\\" -c \\\""
|
||||||
" SELECT conninfo"
|
" SELECT conninfo"
|
||||||
" FROM repmgr.nodes"
|
" FROM repmgr.nodes"
|
||||||
" WHERE %s"
|
" WHERE %s"
|
||||||
" AND active IS TRUE"
|
" AND active IS TRUE"
|
||||||
"\\\"\"",
|
"\\\"",
|
||||||
config_file_options.barman_host,
|
|
||||||
repmgr_conninfo_buf.data,
|
repmgr_conninfo_buf.data,
|
||||||
where_condition);
|
where_condition);
|
||||||
|
|
||||||
termPQExpBuffer(&repmgr_conninfo_buf);
|
termPQExpBuffer(&repmgr_conninfo_buf);
|
||||||
|
|
||||||
command_success = local_command(buf, &command_output);
|
command_success = remote_command(config_file_options.barman_host,
|
||||||
|
runtime_options.remote_user,
|
||||||
|
buf,
|
||||||
|
config_file_options.ssh_options,
|
||||||
|
&command_output);
|
||||||
|
|
||||||
if (command_success == false)
|
if (command_success == false)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user