*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
***************
*** 13064,13071 **** SELECT set_config('log_statement_stats', 'off', false);
The functions shown in assist in making on-line backups.
! Use of the first three functions is restricted to superusers. The first
! five functions cannot be executed during recovery.
--- 13064,13071 ----
The functions shown in assist in making on-line backups.
! These functions cannot be executed during recovery.
! Use of the first three functions is restricted to superusers.
*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
***************
*** 8409,8414 **** pg_xlogfile_name_offset(PG_FUNCTION_ARGS)
--- 8409,8420 ----
HeapTuple resultHeapTuple;
Datum result;
+ if (RecoveryInProgress())
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("recovery is in progress"),
+ errhint("WAL control functions cannot be executed during recovery.")));
+
/*
* Read input and parse
*/
***************
*** 8478,8483 **** pg_xlogfile_name(PG_FUNCTION_ARGS)
--- 8484,8495 ----
XLogRecPtr locationpoint;
char xlogfilename[MAXFNAMELEN];
+ if (RecoveryInProgress())
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("recovery is in progress"),
+ errhint("WAL control functions cannot be executed during recovery.")));
+
locationstr = text_to_cstring(location);
if (sscanf(locationstr, "%X/%X", &uxlogid, &uxrecoff) != 2)