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.