pg_is_xlog_replay_paused(): remove super-user-only restriction

Also update docs to mention which function are super-user-only.

Report by sys-milan@statpro.com

Backpatch through 9.4
This commit is contained in:
Bruce Momjian 2014-08-29 09:05:35 -04:00
parent 88231ec578
commit 01363beae5
2 changed files with 3 additions and 8 deletions

View File

@ -16471,7 +16471,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
<literal><function>pg_xlog_replay_pause()</function></literal> <literal><function>pg_xlog_replay_pause()</function></literal>
</entry> </entry>
<entry><type>void</type></entry> <entry><type>void</type></entry>
<entry>Pauses recovery immediately. <entry>Pauses recovery immediately (restricted to superusers).
</entry> </entry>
</row> </row>
<row> <row>
@ -16479,7 +16479,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
<literal><function>pg_xlog_replay_resume()</function></literal> <literal><function>pg_xlog_replay_resume()</function></literal>
</entry> </entry>
<entry><type>void</type></entry> <entry><type>void</type></entry>
<entry>Restarts recovery if it was paused. <entry>Restarts recovery if it was paused (restricted to superusers).
</entry> </entry>
</row> </row>
</tbody> </tbody>
@ -16587,7 +16587,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
for controlling and interacting with replication features. for controlling and interacting with replication features.
See <xref linkend="streaming-replication"> See <xref linkend="streaming-replication">
and <xref linkend="streaming-replication-slots"> for information about the and <xref linkend="streaming-replication-slots"> for information about the
underlying features. underlying features. Use of these functions is restricted to superusers.
</para> </para>
<para> <para>

View File

@ -382,11 +382,6 @@ pg_xlog_replay_resume(PG_FUNCTION_ARGS)
Datum Datum
pg_is_xlog_replay_paused(PG_FUNCTION_ARGS) pg_is_xlog_replay_paused(PG_FUNCTION_ARGS)
{ {
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
(errmsg("must be superuser to control recovery"))));
if (!RecoveryInProgress()) if (!RecoveryInProgress())
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),