xlog functions for pg_basebackup

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема xlog functions for pg_basebackup
Дата
Msg-id AANLkTikYk1DwuMP348+N4T6ebj+za5S2b0gFPLPKFkjn@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
In cleaning up the streaming part of pg_basebackup, I came across this
gem I copied from elsewherE:

/** We have to use postgres.h not postgres_fe.h here, because there's so much* backend-only stuff in the XLOG include
fileswe need.  But we need a* frontend-ish environment otherwise.  Hence this ugly hack.*/ 
#define FRONTEND 1
#include "postgres.h"


That's obviously quite ugly. I'm getting most defines out of
xlogdefs.h, which loads fine without that hack, but I'm also using the
XLogFileName() macro, which is in xlog_internal.h. The way I see it,
my options are:

1) keep doing wha tI do and include xlog_internal.h which defines it
2) redefine the macro locally (or just duplicate the code - it's only
one line after all, but it's more a matter of principle)
3) move the definition of the macro to some place that can be accessed
externally

thoughts?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Add support for logging the current role
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Add support for logging the current role