Keyring file configuration
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 inspection example now uses the table it creates and the current database key-info function. See site errata.
This setup is intended for development and stores the keys, unencrypted, in a data file you specify.
While keyring files may be acceptable for local or testing environments, proper KMS providers are the recommended approach for production deployments.
You can configure key providers either at the database level (for development and testing) or at the global level (for production).
The steps below provide an example on how to add a database-scoped key provider:
Create a database-scoped file key provider (
file-keyringin this example) in the/tmp/pg_tde_test_local_keyring.perfile:Create a key (
my_default_keyin this example) inside the newly createdfile-keyringprovider:Set the key (
my_default_key) from the key provider (file-keyring):TipYou can check the current database key information (such as the date and time of creation). Run:
Now, create a table using tde_heap:
The newly created table is encrypted with the database key you have set (
my_default_key).TipTo check if your created table is encrypted with tde_heap, run:
If
Access method: tde_heap, then your table is encrypted.Example output
postgres=# \d+ customer_table Table “public.customer_table” Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description ——–+———+———–+———-+———+———+————-+————–+————- a | integer | | | | plain | | | Access method: tde_heap
Further reading
Next, for production deployments, configure a global principal key using a proper KMS provider.
Alternatively, you can skip directly to validating encryption with pg_tde or configuring WAL encryption.
You can also review the available pg_tde functions in Functions.