On Thu, Aug 16, 2018 at 04:10:00PM +0000, PG Bug reporting form wrote:
> Note that the example archive commands in the documentation (using cp) get
> this wrong. Minimal examples of archive commands that do this check
> correctly would be very useful.
This example is wrong for other reasons, one being that archive_command
should sync the archived file before returning its result back to the
backend to make it durable.
> (I worry that the non-WAL files that archive_command and restore_command are
> also invoked for, e.g. the .backup and .history files, have some additional
> or possibly even conflicting requirements.)
Conflicting requirements depend on your cluster and archiving strategy.
Overwriting a WAL segment archived is usually wrong.
--
Michael