diff options
author | Bruce Momjian <bruce@momjian.us> | 2014-08-29 09:05:35 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2014-08-29 09:06:05 -0400 |
commit | 01363beae52700c7425cb2d2452177133dad3e93 (patch) | |
tree | 65bda3a7418c8e906f3c949b9445f456afee41df | |
parent | 88231ec5784a00ce406553276be8a5a443dd3ba0 (diff) | |
download | postgresql-01363beae52700c7425cb2d2452177133dad3e93.tar.gz postgresql-01363beae52700c7425cb2d2452177133dad3e93.zip |
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
-rw-r--r-- | doc/src/sgml/func.sgml | 6 | ||||
-rw-r--r-- | src/backend/access/transam/xlogfuncs.c | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 56b01dc620b..722640b972e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -16471,7 +16471,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> @@ -16479,7 +16479,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> @@ -16587,7 +16587,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> diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index f186468dd2c..133143db929 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -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), |