Re: WAL Archiving and base backup

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Issa Gorissen <issa-gorissen(at)usa(dot)net>, Torsten Förtsch <tfoertsch123(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: WAL Archiving and base backup
Date: 2022-01-18 19:30:21
Message-ID: CAKFQuwYa3ePSX8TYKDcFURYJWAYYUW63kcXM2WT=ALi3aAK2Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 18, 2022 at 10:53 AM Stephen Frost <sfrost(at)snowman(dot)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

1. https://www.postgresql.org/docs/current/reference-server.html

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2022-01-18 19:55:08 Re: WAL Archiving and base backup
Previous Message Stephen Frost 2022-01-18 17:53:03 Re: WAL Archiving and base backup