Add 'basebackup_to_shell' contrib module.
authorRobert Haas <rhaas@postgresql.org>
Tue, 15 Mar 2022 17:24:23 +0000 (13:24 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 15 Mar 2022 17:24:23 +0000 (13:24 -0400)
commitc6306db24bd913375f99494e38ab315befe44e11
tree0af831f7a40ffbd2efa0d6e643a2f38d58f89c4f
parente4ba69f3f4a1b997aa493cc02e563a91c0f35b87
Add 'basebackup_to_shell' contrib module.

As a demonstration of the sort of thing that can be done by adding a
custom backup target, this defines a 'shell' target which executes a
command defined by the system administrator. The command is executed
once for each tar archive generate by the backup and once for the
backup manifest, if any. Each time the command is executed, it
receives the contents of th file for which it is executed via standard
input.

The configured command can use %f to refer to the name of the archive
(e.g. base.tar, $TABLESPACE_OID.tar, backup_manifest) and %d to refer
to the target detail (pg_basebackup --target shell:DETAIL). A target
detail is required if %d appears in the configured command and
forbidden if it does not.

Patch by me, reviewed by Abhijit Menon-Sen.

Discussion: http://postgr.es/m/CA+TgmoaqvdT-u3nt+_kkZ7bgDAyqDB0i-+XOMmr5JN2Rd37hxw@mail.gmail.com
contrib/Makefile
contrib/basebackup_to_shell/Makefile [new file with mode: 0644]
contrib/basebackup_to_shell/basebackup_to_shell.c [new file with mode: 0644]
doc/src/sgml/basebackup-to-shell.sgml [new file with mode: 0644]
doc/src/sgml/contrib.sgml
doc/src/sgml/filelist.sgml