Heikki Linnakangas wrote:
> On 08/05/2014 03:50 PM, Michael Paquier wrote:

> >- All the functions in xlogconstruct.c could be defined in a separate
> >header xlogconstruct.h. What they do is rather independent from xlog.h. The
> >same applies to all the structures and functions of xlogconstruct.c in
> >xlog_internal.h: XLogRecordAssemble, XLogRecordAssemble,
> >InitXLogRecordConstruct. (worth noticing as well that the only reason
> >XLogRecData is defined externally of xlogconstruct.c is that it is being
> >used in XLogInsert()).
> 
> Hmm. I left the defines for xlogconstruct.c functions that are used
> to build a WAL record in xlog.h, so that it's not necessary to
> include both xlog.h and xlogconstruct.h in all files that write a
> WAL record (XLogInsert() is defined in xlog.h).
> 
> But perhaps it would be better to move the prototype for XLogInsert
> to xlogconstruct.h too? That might be a better division; everything
> needed to insert a WAL record would be in xlogconstruct.h, and
> xlog.h would left for more internal functions related to WAL. And
> perhaps rename the files to xloginsert.c and xloginsert.h.

Yes, IMO ideally modules that only construct WAL records to insert, but
are not directly involved with other XLog stuff, should only be using a
lean header file, not the whole xlog.h.  I imagine xlogconstruct.h would
be such a file.  (The patch you just posted doesn't have such a file --
AFAICS that stuff is all in xlog.h still).

No opinion on xlogconstruct vs. xloginsert as file names.  Both seem
like good enough names to me.  Unless others have stronger opinions, I
would left that decision to you.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to