Skip to content

PG-1832 Document the archive and restore commands cont #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: release-17.5.3
Choose a base branch
from

Conversation

Andriciuc
Copy link
Collaborator

Continued from #523

jeltz and others added 2 commits August 12, 2025 14:31
Initial quick documentation for the two new CLI commands. We want to
improve this futuer in the future plus add a proper guide for how to set
up a complete solution.
@AndersAstrand
Copy link
Collaborator

AndersAstrand commented Aug 13, 2025

We have changed how these two commands works since this was written, here are the usage instructions for each:

pg_tde_archive_decrypt

pg_tde_archive_decrypt wraps an archive command to give the command unencrypted WAL.

Usage:
  pg_tde_archive_decrypt [OPTION]
  pg_tde_archive_decrypt DEST-NAME SOURCE-PATH ARCHIVE-COMMAND

Options:
  -V, --version   output version information, then exit
  -?, --help      show this help, then exit
  DEST-NAME       name of the WAL file to send to archive
  SOURCE-PATH     path of the source WAL segment to decrypt
  ARCHIVE-COMMAND archive command to wrap, %p will be replaced with the
                  absolute path of the decrypted WAL segment, %f with the name

Note that any %f or %p parameter in ARCHIVE-COMMAND will have to be escaped
as %%f or %%p respectively if used as archive_command in postgresql.conf.
e.g.
  archive_command='pg_tde_archive_decrypt %f %p "cp %%p /mnt/server/archivedir/%%f"'
or
  archive_command='pg_tde_archive_decrypt %f %p "pgbackrest --stanza=your_stanza archive-push %%p"'

pg_tde_restore_encrypt

pg_tde_restore_encrypt wraps a restore command to encrypt its returned WAL.

Usage:
  pg_tde_restore_encrypt [OPTION]
  pg_tde_restore_encrypt SOURCE-NAME DEST-PATH RESTORE-COMMAND

Options:
  -V, --version   output version information, then exit
  -?, --help      show this help, then exit
  SOURCE-NAME     name of the WAL file to retrieve from archive
  DEST-PATH       path where the encrypted WAL segment should be written
  RESTORE-COMMAND restore command to wrap, %p will be replaced with the path
                  where it should write the unencrypted WAL segment, %f with
                  the WAL segment's name

Note that any %f or %p parameter in RESTORE-COMMAND will have to be escaped
as %%f or %%p respectively if used as restore_command in postgresql.conf.
e.g.
  restore_command='pg_tde_restore_encrypt %f %p "cp /mnt/server/archivedir/%%f %%p"'
or
  restore_command='pg_tde_restore_encrypt %f %p "pgbackrest --stanza=your_stanza archive-get %%f \"%%p\""'

@nastena1606 nastena1606 temporarily deployed to tde-archive-restore-docs-cont - INTERNAL-pg_tde docs PR #531 August 13, 2025 10:31 — with Render Destroyed
@nastena1606 nastena1606 temporarily deployed to tde-archive-restore-docs-cont - INTERNAL-pg_tde docs PR #531 August 13, 2025 10:32 — with Render Destroyed
@nastena1606 nastena1606 temporarily deployed to tde-archive-restore-docs-cont - INTERNAL-pg_tde docs PR #531 August 13, 2025 12:09 — with Render Destroyed
@Andriciuc Andriciuc added the documentation Improvements or additions to documentation label Aug 13, 2025
@nastena1606 nastena1606 temporarily deployed to tde-archive-restore-docs-cont - INTERNAL-pg_tde docs PR #531 August 20, 2025 08:00 — with Render Destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants