Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Дата
Msg-id 1270633296.24910.6600.camel@ebony
обсуждение исходный текст
Ответ на pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()  (heikki@postgresql.org (Heikki Linnakangas))
Список 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 по дате отправления:

Предыдущее
От: heikki@postgresql.org (Heikki Linnakangas)
Дата:
Сообщение: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Следующее
От: heikki@postgresql.org (Heikki Linnakangas)
Дата:
Сообщение: pgsql: Allow quotes to be escaped in recovery.conf, by doubling them.