Enabling encryption for whole database?

Encryption is enabled by CREATE TABLE ... USING pg_tde in the examples. Is it possible to enable TDE globally for all tables in the database? Assume we do not have access to source code of the application that creates the tables, or would want to avoid changing the source code.

Thanks for making this extension! Eager to dig deeper into testing it! :slight_smile:

1 Like


happy to hear you do like our newest extension.

If you modify the default template, you can enable pg_tde on every newly created database by default.

Documented here: Set up - pg_tde documentation

and the important part for you:

You can have the pg_tde extension automatically enabled for every newly created database. Modify the template template1 database as follows:

psql -d template1 -c 'CREATE EXTENSION pg_tde;'

If you have any further questions, don’t hesitate to reach out.


1 Like