On 2020-Sep-07, Tom Lane wrote:

> If there were something to be on the warpath about, it's that initdb
> is pulling in such an obviously backend-only header as that.  I wonder
> if we should refactor to fix that.
> 
> Quick experimentation says that the symbols initdb actually needs out
> of that header are
> 
> DEFAULT_MIN_WAL_SEGS
> DEFAULT_MAX_WAL_SEGS
> IsValidWalSegSize()

Hmm, if we wanted to clean things up I think we should look at what
other things from xlog_internal.h are being used by other frontend
programs; for example it looks like fe_utils/archive.c is pulling
xlog_internal.h just to get XLOGDIR, while pg_controldata needs just
MAXFNAMELEN, XLogFileName and XLByteToSeg (apart from IsValidWalSegSize).

Maybe there's room for a new header that serves the purpose of working
with WAL segment files.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply via email to