pg_tde_archive_decrypt
This is the Percona pg_tde 2.3.0 manual. For the paired build, backup tools and major upgrades, see PG TDE on Mimus.
The pg_tde_archive_decrypt tool wraps an archive command and decrypts WAL files before archiving. It allows external tools to access unencrypted WAL data, which is required because WAL encryption keys in the two-key hierarchy are host-specific and may not be available on the replay host.
For more information on the encryption architecture and key hierarchy, see Architecture.
This tool is often used in conjunction with pg_tde_restore_encrypt to support WAL archive.
How it works
- Decrypts the WAL segment to a temporary file on a RAM disk (
/dev/shm) - Replaces
%pand%fin the archive command with the path and name of the decrypted file - Executes the archive command
To ensure security, encrypt the files stored in your WAL archive using tools like PgBackRest.
Usage
Parameter descriptions
DEST-NAME: name of the WAL file to send to the archiveSOURCE-PATH: path to the original encrypted WAL fileARCHIVE-COMMAND: archive command to wrap.%pand%fare replaced with the decrypted WAL file path and WAL file name, respectively.
Options
-V, --version: show version information, then exit-?, --help: show help information, then exit
Any %f or %p parameter in ARCHIVE-COMMAND has to be escaped as %%f or %%p respectively if used as archive_command in postgresql.conf.
Examples
Using cp
Using PgBackRest
A deployment with WAL encryption is not supported unless archive_command uses pg_tde_archive_decrypt and restore_command uses pg_tde_restore_encrypt.
Disable the following pgBackRest features in the applicable pgBackRest configuration section: