mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Update configuration file conversion script
Ensure output is quoted.
This commit is contained in:
@@ -73,7 +73,16 @@ while(<$fh>) {
|
|||||||
if ($param eq 'data_directory') {
|
if ($param eq 'data_directory') {
|
||||||
$data_directory_found = 1;
|
$data_directory_found = 1;
|
||||||
}
|
}
|
||||||
push @outp, $line;
|
|
||||||
|
# Don't quote numbers
|
||||||
|
if ($value =~ /^\d+$/) {
|
||||||
|
push @outp, sprintf(q|%s=%s|, $param, $value);
|
||||||
|
}
|
||||||
|
# Quote everything else
|
||||||
|
else {
|
||||||
|
$value =~ s/'/''/g;
|
||||||
|
push @outp, sprintf(q|%s='%s'|, $param, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +92,6 @@ print join("\n", @outp);
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
if ($data_directory_found == 0) {
|
if ($data_directory_found == 0) {
|
||||||
print "data_directory=\n";
|
print "data_directory=''\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -419,13 +419,13 @@ ALTER EXTENSION repmgr UPDATE</programlisting>
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
$ ./convert-config.pl /etc/repmgr.conf
|
$ ./convert-config.pl /etc/repmgr.conf
|
||||||
node_id=2
|
node_id=2
|
||||||
node_name=node2
|
node_name='node2'
|
||||||
conninfo=host=node2 dbname=repmgr user=repmgr connect_timeout=2
|
conninfo='host=node2 dbname=repmgr user=repmgr connect_timeout=2'
|
||||||
pg_ctl_options='-l /var/log/postgres/startup.log'
|
pg_ctl_options='-l /var/log/postgres/startup.log'
|
||||||
rsync_options=--exclude=postgresql.local.conf --archive
|
rsync_options='--exclude=postgresql.local.conf --archive'
|
||||||
log_level=INFO
|
log_level='INFO'
|
||||||
pg_basebackup_options=--no-slot
|
pg_basebackup_options='--no-slot'
|
||||||
data_directory=</programlisting>
|
data_directory=''</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The converted file is printed to <literal>STDOUT</literal> and the original file is not
|
The converted file is printed to <literal>STDOUT</literal> and the original file is not
|
||||||
@@ -434,8 +434,7 @@ ALTER EXTENSION repmgr UPDATE</programlisting>
|
|||||||
<para>
|
<para>
|
||||||
Please note that the the conversion script will add an empty
|
Please note that the the conversion script will add an empty
|
||||||
placeholder parameter for <varname>data_directory</varname>, which
|
placeholder parameter for <varname>data_directory</varname>, which
|
||||||
is a required parameter in repmgr4 and which <emphasis>must</emphasis>
|
is a required parameter from &repmgr; 4.
|
||||||
be provided.
|
|
||||||
</para>
|
</para>
|
||||||
</sect3>
|
</sect3>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|||||||
Reference in New Issue
Block a user