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:
Ian Barwick
2020-03-06 12:50:23 +09:00
parent 7c96afc6fb
commit fb5ce720f3
6 changed files with 111 additions and 42 deletions

View File

@@ -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