mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
standby promote: fall back to "pg_ctl promote" if necessary
From PostgreSQL 12, the SQL-level function "pg_promote()" can be used to promote a PostgreSQL instance, however usage is restricted to superusers and users to whom explicit execution permission for this function has been granted. Therefore, if execution permission is not available, fall back to "pg_ctl promote".
This commit is contained in:
@@ -88,6 +88,16 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="repmgr-standby-promote"><command>repmgr standby promote</command></link>
|
||||
will check if the <literal>repmgr</literal> user has permission to execute
|
||||
<function>pg_promote()</function> and fall back to <command>pg_ctl promote</command> if
|
||||
necessary.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Fix situation where replication connections were not created correctly, which
|
||||
|
||||
@@ -106,20 +106,22 @@
|
||||
<title>User permission requirements</title>
|
||||
<para><emphasis>pg_promote() (PostgreSQL 12)</emphasis></para>
|
||||
<para>
|
||||
From PostgreSQL 12, &repmgr; uses the <command>pg_promote()</command> function to promote a standby
|
||||
to primary.
|
||||
From PostgreSQL 12, &repmgr; will attempt to use the <function>pg_promote()</function> function
|
||||
to promote a standby to primary.
|
||||
</para>
|
||||
<para>
|
||||
By default, execution of <command>pg_promote()</command> is restricted to superusers.
|
||||
If the <literal>repmgr</literal> use is not a superuser, execution permission for this
|
||||
function must be granted with e.g.:
|
||||
<programlisting>
|
||||
By default, execution of <function>pg_promote()</function> is restricted to superusers.
|
||||
If the <literal>repmgr</literal> user does not have permission to execute
|
||||
<function>pg_promote()</function>, &repmgr; will fall back to using <command>pg_ctl promote</command>.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
If the <literal>repmgr</literal> user is not a superuser, execution permission for this
|
||||
function can be granted with e.g.:
|
||||
<programlisting>
|
||||
GRANT EXECUTE ON FUNCTION pg_catalog.pg_promote TO repmgr</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
A future &repmgr; release will relax this restriction by falling back to
|
||||
<command>pg_ctl promote</command>, as used for pre-PostgreSQL 12 versions.
|
||||
</para>
|
||||
</para>
|
||||
</tip>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
|
||||
Reference in New Issue
Block a user