Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset() - Mailing list pgsql-committers

From Simon Riggs
Subject Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Date
Msg-id 1270633296.24910.6600.camel@ebony
Whole thread Raw
In response to pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()  (heikki@postgresql.org (Heikki Linnakangas))
List pgsql-committers
On Wed, 2010-04-07 at 06:12 +0000, Heikki Linnakangas wrote:
> Log Message:
> -----------
> Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset() during
> recovery. We might want to relax this in the future, but ThisTimeLineID
> isn't currently correct in backends during recovery, so the filename
> returned was wrong.

Any reason why we couldn't just do this:

if (RecoveryInProgress())
{
    volatile XLogCtlData *xlogctl = XLogCtl;
    XLogFileName(xlogfilename, xlogctl->ThisTimeLineID,
            xlogid, xlogseg);
}
else
    XLogFileName(xlogfilename, ThisTimeLineID, xlogid, xlogseg);


rather than preventing access to those functions completely?

--
 Simon Riggs           www.2ndQuadrant.com


pgsql-committers by date:

Previous
From: heikki@postgresql.org (Heikki Linnakangas)
Date:
Subject: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Next
From: heikki@postgresql.org (Heikki Linnakangas)
Date:
Subject: pgsql: Allow quotes to be escaped in recovery.conf, by doubling them.