Uninstall pg_tde¶
If you no longer wish to use TDE in your deployment, you can remove the pg_tde extension. To do that, your user must have the privileges of the superuser or a database owner.
Here’s how to do it:
- Drop the extension using the
DROP EXTENSIONwithCASCADEcommand.
Warning: The use of the CASCADE parameter deletes all tables that were created in the database with pg_tde enabled and also all dependencies upon the encrypted table (e.g. foreign keys in a non-encrypted table used in the encrypted one).
DROP EXTENSION pg_tde CASCADE
-
Run the
DROP EXTENSIONcommand against every database where you have enabled thepg_tdeextension -
Modify the
shared_preload_librariesand remove the ‘pg_tde’ from it. Use theALTER SYSTEM SETcommand for this purpose -
Start or restart the
postgreinstance to apply the changes.- On Debian and Ubuntu:
sudo systemctl restart postgre.service- On RHEL and derivatives
sudo systemctl restart postgre-17