mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
standby promote: enable "service_promote_command" in PostgreSQL 12
This enables the promote command generated internally by repmgr to be overridden if desired, in the same way as for PostgreSQL 11 and earlier.
This commit is contained in:
3
HISTORY
3
HISTORY
@@ -1,4 +1,4 @@
|
||||
5.1 2019-??-??
|
||||
5.1 2020-??-??
|
||||
repmgr: remove BDR 2.x support
|
||||
repmgr: don't query upstream's data directory (Ian)
|
||||
repmgr: rename --recovery-conf-only to --replication-conf-only (Ian)
|
||||
@@ -14,6 +14,7 @@
|
||||
repmgr: consolidate replication connection code (Ian)
|
||||
repmgr: check permissions for "pg_promote()" and fall back to pg_ctl
|
||||
if necessary (Ian)
|
||||
repmgr: enable "service_promote_command" in PostgreSQL 12 (Ian)
|
||||
|
||||
5.0 2019-10-15
|
||||
general: add PostgreSQL 12 support (Ian)
|
||||
|
||||
@@ -97,6 +97,12 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="repmgr-standby-promote"><command>repmgr standby promote</command></link>:
|
||||
in PostgreSQL 12 and later, use <varname>service_promote_command</varname> if set.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -195,6 +195,23 @@
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>service_promote_command</primary>
|
||||
<secondary>with "repmgr standby promote "</secondary>
|
||||
</indexterm>
|
||||
<simpara>
|
||||
<literal>service_promote_command</literal>:
|
||||
a command which will be executed instead of <command>pg_ctl promote</command>
|
||||
or (in PostgreSQL 12 and later) <function>pg_promote()</function>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
This is intended for systems which provide a package-level promote command,
|
||||
such as Debian's <application>pg_ctlcluster</application>, to promote the
|
||||
PostgreSQL from standby to primary.
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
|
||||
@@ -2487,7 +2487,11 @@ _do_standby_promote_internal(PGconn *conn)
|
||||
{
|
||||
use_pg_promote = true;
|
||||
|
||||
if (can_execute_pg_promote(conn) == false)
|
||||
if (config_file_options.service_promote_command[0] != '\0')
|
||||
{
|
||||
use_pg_promote = false;
|
||||
}
|
||||
else if (can_execute_pg_promote(conn) == false)
|
||||
{
|
||||
use_pg_promote = false;
|
||||
log_info(_("user \"%s\" does not have permission to execute \"pg_promote()\", falling back to \"pg_ctl promote\""),
|
||||
|
||||
Reference in New Issue
Block a user