Skip to content

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:

  1. Drop the extension using the DROP EXTENSION with CASCADE command.

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
  1. Run the DROP EXTENSION command against every database where you have enabled the pg_tde extension

  2. Modify the shared_preload_libraries and remove the ‘pg_tde’ from it. Use the ALTER SYSTEM SET command for this purpose

  3. Start or restart the postgresql instance to apply the changes.

    • On Debian and Ubuntu:
    sudo systemctl restart postgresql.service
    
    • On RHEL and derivatives
    sudo systemctl restart postgresql-16
    

Get expert help

If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.