Allow archiving via loadable modules.
authorRobert Haas <rhaas@postgresql.org>
Thu, 3 Feb 2022 18:57:27 +0000 (13:57 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 3 Feb 2022 19:05:02 +0000 (14:05 -0500)
commit5ef1eefd76f404ddc59b885d50340e602b70f05f
tree85146bd90a7039c50498ff09aedbc501468afb65
parent7c1aead6cbe7dcc6c216715fed7a1fb60684c5dc
Allow archiving via loadable modules.

Running a shell command for each file to be archived has a lot of
overhead and may not offer as much error checking as you want, or the
exact semantics that you want. So, offer the option to call a loadable
module for each file to be archived, rather than running a shell command.

Also, add a 'basic_archive' contrib module as an example implementation
that archives to a local directory.

Nathan Bossart, with a little bit of kibitzing by me.

Discussion: http://postgr.es/m/20220202224433.GA1036711@nathanxps13
26 files changed:
contrib/Makefile
contrib/basic_archive/.gitignore [new file with mode: 0644]
contrib/basic_archive/Makefile [new file with mode: 0644]
contrib/basic_archive/basic_archive.c [new file with mode: 0644]
contrib/basic_archive/basic_archive.conf [new file with mode: 0644]
contrib/basic_archive/expected/basic_archive.out [new file with mode: 0644]
contrib/basic_archive/sql/basic_archive.sql [new file with mode: 0644]
doc/src/sgml/archive-modules.sgml [new file with mode: 0644]
doc/src/sgml/backup.sgml
doc/src/sgml/basic-archive.sgml [new file with mode: 0644]
doc/src/sgml/config.sgml
doc/src/sgml/contrib.sgml
doc/src/sgml/filelist.sgml
doc/src/sgml/high-availability.sgml
doc/src/sgml/postgres.sgml
doc/src/sgml/ref/pg_basebackup.sgml
doc/src/sgml/ref/pg_receivewal.sgml
doc/src/sgml/wal.sgml
src/backend/access/transam/xlog.c
src/backend/postmaster/pgarch.c
src/backend/postmaster/shell_archive.c
src/backend/utils/init/miscinit.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/include/access/xlog.h
src/include/postmaster/pgarch.h