Re: Move backup-related code to xlogbackup.c/.h - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Move backup-related code to xlogbackup.c/.h
Date
Msg-id 20221005175821.3iweibr4wzgbzctu@alvherre.pgsql
Whole thread Raw
In response to Re: Move backup-related code to xlogbackup.c/.h  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 2022-Oct-05, Michael Paquier wrote:

> And FWIW, the SQL interfaces for pg_backup_start() and
> pg_backup_stop() could stay in xlogfuncs.c.  This has the advantage to
> centralize in the same file all the SQL-function-specific checks.

As I recall, that has the disadvantage that the API exposure is a bit
higher -- I mean, with the patch as originally posted, there was less
cross-inclusion of header files, but that is gone in the version Bharat
posted as reply to this.  I'm not sure if that's caused by *this*
comment, or even that it's terribly significant, but it seems worth
considering at least.

xlog.h is included by a lot of stuff, so it would be great if it
itself included the smallest set of other files possible.

... that said, looking at the chart in
https://doxygen.postgresql.org//xlog_8h.html looks like the only file
we'd avoid indirectly including is pgtime.h (in addition to xlogbackup.h
itself).


(It's strange that xlog.h seems to have become included into rel.h by
commit 848ef42bb8c7 that did not otherwise touch either rel.h nor xlog.h.)

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: archive modules
Next
From: Nathan Bossart
Date:
Subject: Re: Suppressing useless wakeups in walreceiver