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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5ef1eefd76f404ddc59b885d50340e602b70f05f
Modified Files
--------------
contrib/Makefile | 1 +
contrib/basic_archive/.gitignore | 4 +
contrib/basic_archive/Makefile | 20 ++
contrib/basic_archive/basic_archive.c | 371 +++++++++++++++++++++++
contrib/basic_archive/basic_archive.conf | 3 +
contrib/basic_archive/expected/basic_archive.out | 29 ++
contrib/basic_archive/sql/basic_archive.sql | 22 ++
doc/src/sgml/archive-modules.sgml | 136 +++++++++
doc/src/sgml/backup.sgml | 85 ++++--
doc/src/sgml/basic-archive.sgml | 81 +++++
doc/src/sgml/config.sgml | 37 ++-
doc/src/sgml/contrib.sgml | 1 +
doc/src/sgml/filelist.sgml | 2 +
doc/src/sgml/high-availability.sgml | 6 +-
doc/src/sgml/postgres.sgml | 1 +
doc/src/sgml/ref/pg_basebackup.sgml | 4 +-
doc/src/sgml/ref/pg_receivewal.sgml | 6 +-
doc/src/sgml/wal.sgml | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/postmaster/pgarch.c | 110 ++++++-
src/backend/postmaster/shell_archive.c | 24 +-
src/backend/utils/init/miscinit.c | 1 +
src/backend/utils/misc/guc.c | 12 +-
src/backend/utils/misc/postgresql.conf.sample | 3 +
src/include/access/xlog.h | 1 -
src/include/postmaster/pgarch.h | 38 ++-
26 files changed, 938 insertions(+), 64 deletions(-)