Re: WAL Archiving and base backup - Mailing list pgsql-general

From David G. Johnston
Subject Re: WAL Archiving and base backup
Date
Msg-id CAKFQuwYa3ePSX8TYKDcFURYJWAYYUW63kcXM2WT=ALi3aAK2Gw@mail.gmail.com
Whole thread Raw
In response to Re: WAL Archiving and base backup  (Stephen Frost <sfrost@snowman.net>)
Responses Re: WAL Archiving and base backup
List pgsql-general
On Tue, Jan 18, 2022 at 10:53 AM Stephen Frost <sfrost@snowman.net> wrote:
We already have pg_receivewal, which is part of pg_basebackup, and is
able to use a slot and such.  I'm not sure that making pg_basebackup
somehow also work as an archive command makes much sense

I suppose my proposal should have been:

Create and document a new "PostgreSQL Server Application" [1] and name it: pg_archive_wal
Advise people to set their archive_command to "pg_archive_wal --path=/location/of/archive %p/%f


Having pg_basebackup still prompt for permission to add that command to the system via ALTER SYSTEM (probably will some other logic) seems doable.

Having created a base backup one still must decide on a wal archiving strategy.  There appear to be two options, though as far as I can tell if one simply reads the documentation regarding backups they will not discover the pg_receivewal option.  I, not knowing of that option myself, have been operating under the assumption that if one uses pg_basebackup that one would be required to setup an archive_command as well.

The superior option is having a persistently running pg_receivewal command on a server.  As noted above, the documentation does not do this option justice.
The alternative option is to set archive_command; which at present is also poorly documented.  My proposal above simply tries to improve on this.  And while that is a good and easy starting point if there is agreement on pg_receivewal being a superior archiving option (leaving archive_command unset) reworking the documentation to guide the inexperience PostgreSQL DBA toward a "minimal but effective" backup procedure is needed.

David J.

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: WAL Archiving and base backup
Next
From: Stephen Frost
Date:
Subject: Re: WAL Archiving and base backup