Skip to content

pg_vault_tde

Transparent Data Encryption for PostgreSQL through custom table and index access methods

pg_vault_tde · Transparent Data Encryption for PostgreSQL through custom table and index access methods

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
7510pg_vault_tdepg_vault_tde1.7.2SECPostgreSQLC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd--YesYesYesYesnono
pkg 1.7.2; SQL 1.7; PG17+, OpenSSL 3/no EL8; preload; export 1.7.0 encrypted TOAST with old binary; rewrite encrypted tables; coordinate custom WAL 128->161 on primary/standbys.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.7.219 18 17 16 15pg_vault_tde-
RPMPIGSTY1.7.219 18 17 16 15pg_vault_tde_$vopenssl-libs, libcurl
DEBPIGSTY1.7.219 18 17 16 15postgresql-$v-pg-vault-tde`libssl3
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/AN/AN/AN/AN/A
el8.aarch64N/AN/AN/AN/AN/A
el9.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
el9.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
el10.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
el10.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
d12.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
d12.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
d13.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
d13.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u22.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u22.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u24.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u24.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u26.x86_64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
u26.aarch64N/APIGSTY 1.7.2PIGSTY 1.7.2N/AN/A
PackageVersionOSORGSIZEFile URL
pg_vault_tde_181.7.2el9.x86_64pigsty423.2 KiBpg_vault_tde_18-1.7.2-1PGSTY.el9.x86_64.rpm
pg_vault_tde_181.7.2el9.aarch64pigsty415.1 KiBpg_vault_tde_18-1.7.2-1PGSTY.el9.aarch64.rpm
pg_vault_tde_181.7.2el10.x86_64pigsty427.5 KiBpg_vault_tde_18-1.7.2-1PGSTY.el10.x86_64.rpm
pg_vault_tde_181.7.2el10.aarch64pigsty418.5 KiBpg_vault_tde_18-1.7.2-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-vault-tde1.7.2d12.x86_64pigsty425.7 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-vault-tde1.7.2d12.aarch64pigsty411.5 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-vault-tde1.7.2d13.x86_64pigsty426.4 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~trixie_amd64.deb
postgresql-18-pg-vault-tde1.7.2d13.aarch64pigsty412.1 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~trixie_arm64.deb
postgresql-18-pg-vault-tde1.7.2u22.x86_64pigsty445.2 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~jammy_amd64.deb
postgresql-18-pg-vault-tde1.7.2u22.aarch64pigsty434.6 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~jammy_arm64.deb
postgresql-18-pg-vault-tde1.7.2u24.x86_64pigsty435.3 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~noble_amd64.deb
postgresql-18-pg-vault-tde1.7.2u24.aarch64pigsty426.9 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~noble_arm64.deb
postgresql-18-pg-vault-tde1.7.2u26.x86_64pigsty432.7 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~resolute_amd64.deb
postgresql-18-pg-vault-tde1.7.2u26.aarch64pigsty424.0 KiBpostgresql-18-pg-vault-tde_1.7.2-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_vault_tde_171.7.2el9.x86_64pigsty424.5 KiBpg_vault_tde_17-1.7.2-1PGSTY.el9.x86_64.rpm
pg_vault_tde_171.7.2el9.aarch64pigsty416.2 KiBpg_vault_tde_17-1.7.2-1PGSTY.el9.aarch64.rpm
pg_vault_tde_171.7.2el10.x86_64pigsty428.9 KiBpg_vault_tde_17-1.7.2-1PGSTY.el10.x86_64.rpm
pg_vault_tde_171.7.2el10.aarch64pigsty420.2 KiBpg_vault_tde_17-1.7.2-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-vault-tde1.7.2d12.x86_64pigsty427.4 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-vault-tde1.7.2d12.aarch64pigsty413.4 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-vault-tde1.7.2d13.x86_64pigsty428.2 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~trixie_amd64.deb
postgresql-17-pg-vault-tde1.7.2d13.aarch64pigsty413.9 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~trixie_arm64.deb
postgresql-17-pg-vault-tde1.7.2u22.x86_64pigsty491.2 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~jammy_amd64.deb
postgresql-17-pg-vault-tde1.7.2u22.aarch64pigsty482.6 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~jammy_arm64.deb
postgresql-17-pg-vault-tde1.7.2u24.x86_64pigsty436.7 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~noble_amd64.deb
postgresql-17-pg-vault-tde1.7.2u24.aarch64pigsty429.1 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~noble_arm64.deb
postgresql-17-pg-vault-tde1.7.2u26.x86_64pigsty434.0 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~resolute_amd64.deb
postgresql-17-pg-vault-tde1.7.2u26.aarch64pigsty425.4 KiBpostgresql-17-pg-vault-tde_1.7.2-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_vault_tde;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_vault_tde;		# install by package name

pig install pg_vault_tde -v 18;   # install for PG 18
pig install pg_vault_tde -v 17;   # install for PG 17

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_vault_tde';

Create this extension with:

CREATE EXTENSION pg_vault_tde;

Usage

Sources:

pg_vault_tde distribution 1.7.2 encrypts table values with AES-256-GCM through encrypted_heap, using Vault/OpenBao, a local PKCS#12 wallet or PKCS#11. SQL/control version remains 1.7. PostgreSQL 17–18, OpenSSL 3 and libcurl are required. Configure the key provider and authentication, preload the library, and restart before creating it as a superuser.

Core Workflow

shared_preload_libraries = 'pg_vault_tde'
CREATE EXTENSION pg_vault_tde;
SELECT * FROM pg_vault_tde_health_check();
CREATE TABLE customer_secrets (id bigint, secret text) USING encrypted_heap;
CREATE INDEX customer_secrets_id_idx ON customer_secrets USING tde_btree (id);

Operational Boundaries

This example assumes a configured provider. pg_vault_tde_health_check, pg_vault_tde_verify_integrity, pg_vault_tde_get_rotation_status and encrypted-size helpers expose operational state. tde_btree supports encrypted equality lookup, not ordering/range or index-only scans. Numeric and nondeterministic-collation encrypted indexes are unsupported; audit old unique/exclusion constraints because their checks may be ineffective. Plain indexes can expose keys, and pg_dump/COPY produce decrypted output. Protect external wallets/KMS and use the matching encrypted-backup tools where supported. Tuple headers, statistics, logs and query results are outside this protection.

Before replacing an older library or restarting, follow the upstream recovery checklist: earlier rotated tables may depend on keys held only in memory; concurrent rotation may require copying data while still readable, and rotated out-of-line values need the specified rewrite. Version 1.7.0 TOAST upgrades also have a separate export requirement. Check rotated/partial indexes and wallet ownership. After upgrading to 1.7.2, every pre-existing encrypted table needs VACUUM FULL to migrate its tuple layout; reserve a maintenance window and extra disk space. When pg_vault_tde.toast_custom_rmgr is enabled, the WAL ID changes from 128 to 161: clean shutdown, coordinated primary/standby upgrade, slot drainage and a new base backup are required. There is no rolling upgrade across those WAL formats.

Run key-management operations one at a time. Table rotation keeps reads available but blocks writes for one transaction; logical slots must decode the rotation before a restart or another rotation. Version 1.7.2 tightens caller privileges, but upstream documents remaining SECURITY DEFINER wrapper limitations; follow the listed grants/revokes. Do not toggle pg_vault_tde.enabled on a populated encrypted table. These catalog updates do not perform an operational upgrade or change the Pigsty package baseline.

Table reader