On 2016/05/19 17:34, Amit Langote wrote:
> Currently in HEAD and 9.6, one can issue a non-exclusive backup on
> standby, so this is OK:
>
> select pg_is_in_recovery();
> pg_is_in_recovery
> -------------------
> t
> (1 row)
>
> select pg_start_backup('sby-bkp-test', 'f', 'f');
> pg_start_backup
> -----------------
> 0/5000220
> (1 row)
>
> However the following happens:
>
> select pg_xlogfile_name_offset(pg_start_backup('sby-bkp-test', 'f', 'f'));
> ERROR: recovery is in progress
> HINT: pg_xlogfile_name_offset() cannot be executed during recovery.
>
> Should this restriction be relaxed or am I missing something?
Answering my own question:
While reading the thread "BUG #14230: Wrong timeline returned by
pg_stop_backup on a standby", I came to know that ThisTimelineId is
invalid on standby. And because pg_xlogfile_name_offset() uses the same
to compute its result, it makes sense to prevent it from being used on a
standby.
Thanks,
Amit