*** 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 *************** *** 8410,8415 **** pg_xlogfile_name_offset(PG_FUNCTION_ARGS) --- 8410,8421 ---- HeapTuple resultHeapTuple; Datum result; + if (RecoveryInProgress()) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("recovery is in progress"), + errhint("pg_xlogfile_name_offset() cannot be executed during recovery."))); + /* * Read input and parse */ *************** *** 8479,8484 **** pg_xlogfile_name(PG_FUNCTION_ARGS) --- 8485,8496 ---- XLogRecPtr locationpoint; char xlogfilename[MAXFNAMELEN]; + if (RecoveryInProgress()) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("recovery is in progress"), + errhint("pg_xlogfile_name() cannot be executed during recovery."))); + locationstr = text_to_cstring(location); if (sscanf(locationstr, "%X/%X", &uxlogid, &uxrecoff) != 2)