]> granicus.if.org Git - postgresql/commitdiff
pg_is_xlog_replay_paused(): remove super-user-only restriction
authorBruce Momjian <bruce@momjian.us>
Fri, 29 Aug 2014 13:05:35 +0000 (09:05 -0400)
committerBruce Momjian <bruce@momjian.us>
Fri, 29 Aug 2014 13:05:40 +0000 (09:05 -0400)
Also update docs to mention which function are super-user-only.

Report by sys-milan@statpro.com

Backpatch through 9.4

doc/src/sgml/func.sgml
src/backend/access/transam/xlogfuncs.c

index c715ca25508b9ec06998784a274eca225144dd5c..1cc80a540acc5d02520672ac53a9b978907ea102 100644 (file)
@@ -16469,7 +16469,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
         <literal><function>pg_xlog_replay_pause()</function></literal>
         </entry>
        <entry><type>void</type></entry>
-       <entry>Pauses recovery immediately.
+       <entry>Pauses recovery immediately (restricted to superusers).
        </entry>
       </row>
       <row>
@@ -16477,7 +16477,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
         <literal><function>pg_xlog_replay_resume()</function></literal>
         </entry>
        <entry><type>void</type></entry>
-       <entry>Restarts recovery if it was paused.
+       <entry>Restarts recovery if it was paused (restricted to superusers).
        </entry>
       </row>
      </tbody>
@@ -16585,7 +16585,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
     for controlling and interacting with replication features.
     See <xref linkend="streaming-replication">
     and <xref linkend="streaming-replication-slots"> for information about the
-    underlying features.
+    underlying features.  Use of these functions is restricted to superusers.
    </para>
 
    <para>
index f186468dd2c2dd260bc4831bddb7e27f62fae1a5..133143db9293ad5b592a19fec0b26e6a62f8c214 100644 (file)
@@ -382,11 +382,6 @@ pg_xlog_replay_resume(PG_FUNCTION_ARGS)
 Datum
 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())
                ereport(ERROR,
                                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),