Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f08b5e7

Browse files
committed
pg_is_xlog_replay_paused(): remove super-user-only restriction
Also update docs to mention which function are super-user-only. Report by [email protected] Backpatch through 9.4
1 parent 08bff29 commit f08b5e7

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16469,15 +16469,15 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1646916469
<literal><function>pg_xlog_replay_pause()</function></literal>
1647016470
</entry>
1647116471
<entry><type>void</type></entry>
16472-
<entry>Pauses recovery immediately.
16472+
<entry>Pauses recovery immediately (restricted to superusers).
1647316473
</entry>
1647416474
</row>
1647516475
<row>
1647616476
<entry>
1647716477
<literal><function>pg_xlog_replay_resume()</function></literal>
1647816478
</entry>
1647916479
<entry><type>void</type></entry>
16480-
<entry>Restarts recovery if it was paused.
16480+
<entry>Restarts recovery if it was paused (restricted to superusers).
1648116481
</entry>
1648216482
</row>
1648316483
</tbody>
@@ -16585,7 +16585,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1658516585
for controlling and interacting with replication features.
1658616586
See <xref linkend="streaming-replication">
1658716587
and <xref linkend="streaming-replication-slots"> for information about the
16588-
underlying features.
16588+
underlying features. Use of these functions is restricted to superusers.
1658916589
</para>
1659016590

1659116591
<para>

src/backend/access/transam/xlogfuncs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,6 @@ pg_xlog_replay_resume(PG_FUNCTION_ARGS)
382382
Datum
383383
pg_is_xlog_replay_paused(PG_FUNCTION_ARGS)
384384
{
385-
if (!superuser())
386-
ereport(ERROR,
387-
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
388-
(errmsg("must be superuser to control recovery"))));
389-
390385
if (!RecoveryInProgress())
391386
ereport(ERROR,
392387
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),

0 commit comments

Comments
 (0)