Uninstall TimescaleDB
Uninstall TimescaleDB without uninstalling PostgreSQL
You can uninstall TimescaleDB without uninstalling PostgreSQL. Choose your platform below.
If you installed TimescaleDB using Docker, you can completely remove the TimescaleDB container, image, and optionally the data volumes.
- Stop the running container
Terminal window docker stop timescaledbIf you named your container differently when you created it, replace
timescaledbwith your container name. - Remove the container
Terminal window docker rm timescaledbThis removes the container but preserves the data volume and the Docker image.
- List and remove the Docker image
-
See which TimescaleDB images you have installed:
Terminal window docker images | grep timescaleYou see something like:
Terminal window timescale/timescaledb-ha pg18 1ec79f20f47d 9 hours ago 6.2GB -
Remove the TimescaleDB image:
Terminal window docker rmi timescale/timescaledb-ha:pg18Terminal window docker rmi timescale/timescaledb:latest-pg18Replace
pg18with your PostgreSQL version.
-
- (Optional) Remove the dataWarning
This step permanently deletes all your database data. Only proceed if you’re sure you no longer need this data or have backed it up.
List all Docker volumes:
Terminal window docker volume lsIf you used a named volume when creating your container, remove it:
Terminal window docker volume rm <volume-name>If you used a host directory mount (with the
-v </a/local/data/folder>:/pgdataflag), you can manually delete that directory:Terminal window rm -rf </a/local/data/folder>
If you deployed TimescaleDB on Kubernetes, you can completely remove all associated resources including the StatefulSet, Service, PersistentVolumeClaim, Secret, and application deployments.
- Back up any important data from your TimescaleDB instance
Terminal window kubectl exec -it timescaledb-0 -- pg_dump -U postgres postgres > backup.sql - If you created a test pod during installation, delete it
Terminal window kubectl delete pod test-pod - Remove any application deployments that connect to TimescaleDB
Terminal window kubectl delete deployment tigerdata-app - Remove the service that exposes TimescaleDB within the cluster
Terminal window kubectl delete service timescaledb - Delete the StatefulSet managing the TimescaleDB pods
Terminal window kubectl delete statefulset timescaledbThis terminates the TimescaleDB pod.
- Delete the PersistentVolumeClaimWarning
Deleting the PersistentVolumeClaim permanently deletes all your database data. Ensure you have backed up any data you need before proceeding.
Terminal window kubectl delete pvc tigerdata-pvc - Remove the Kubernetes secret containing database credentials
Terminal window kubectl delete secret tigerdata-secret - (Optional) Delete the namespace
If you created a dedicated namespace for TimescaleDB, you can remove it as well.
WarningOnly delete the namespace if you’re certain no other resources are using it. This will delete all resources in the namespace.
Terminal window kubectl delete namespace tigerdata
Take the following steps to uninstall TimescaleDB based on your distribution:
- Drop the TimescaleDB extension from your databases
-
Connect to each database where TimescaleDB is enabled and remove the extension:
Terminal window sudo -u postgres psql -d <database_name> -
At the
psqlprompt:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /etc/postgresql/18/main/postgresql.confFind the line with
shared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. - Restart PostgreSQL
Terminal window sudo systemctl restart postgresql - Uninstall the TimescaleDB package
Terminal window sudo apt remove timescaledb-2-postgresql-18Replace
18with your PostgreSQL version if different. - Remove the TimescaleDB repository configuration
Terminal window sudo rm /etc/apt/sources.list.d/timescaledb.listsudo rm /etc/apt/trusted.gpg.d/timescaledb.gpgsudo apt update - Remove dependencies
Remove unused dependencies installed with TimescaleDB:
WarningThis step may also remove PostgreSQL as a dependency.
Terminal window sudo apt autoremove
- Drop the TimescaleDB extension from your databases
-
Connect to each database where TimescaleDB is enabled and remove the extension:
Terminal window sudo -u postgres psql -d <database_name> -
At the
psqlprompt:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /etc/postgresql/18/main/postgresql.confFind the line with
shared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. - Restart PostgreSQL
Terminal window sudo systemctl restart postgresql - Uninstall the TimescaleDB package
Terminal window sudo apt remove timescaledb-2-postgresql-18Replace
18with your PostgreSQL version if different. - Remove the TimescaleDB repository configuration
Terminal window sudo rm /etc/apt/sources.list.d/timescaledb.listsudo rm /etc/apt/trusted.gpg.d/timescaledb.gpgsudo apt update - Remove dependencies
Remove unused dependencies installed with TimescaleDB:
WarningThis step may also remove PostgreSQL as a dependency.
Terminal window sudo apt autoremove
- Drop the TimescaleDB extension from your databases
-
Connect to each database where TimescaleDB is enabled and remove the extension:
Terminal window sudo -u postgres psql -d <database_name> -
At the
psqlprompt:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /var/lib/pgsql/18/data/postgresql.confPress
/to search, typeshared_preload_libraries, and press Enter. Pressito edit. Find the line withshared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. PressEsc, then type:wqand press Enter to save. - Restart PostgreSQL
Terminal window sudo systemctl restart postgresql-18Replace
18with your PostgreSQL version if different. - Uninstall the TimescaleDB package
Terminal window sudo dnf remove timescaledb-2-postgresql-18Replace
18with your PostgreSQL version if different. - Remove the TimescaleDB repository configuration
Terminal window sudo rm /etc/yum.repos.d/timescale_timescaledb.repo - Remove dependencies
Remove unused dependencies installed with TimescaleDB:
WarningThis step may also remove PostgreSQL as a dependency.
Terminal window sudo dnf autoremove
- Drop the TimescaleDB extension from your databases
-
Connect to each database where TimescaleDB is enabled and remove the extension:
Terminal window sudo -u postgres psql -d <database_name> -
At the
psqlprompt:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /var/lib/pgsql/18/data/postgresql.confPress
/to search, typeshared_preload_libraries, and press Enter. Pressito edit. Find the line withshared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. - Restart PostgreSQL
Terminal window sudo systemctl restart postgresql-18Replace
18with your PostgreSQL version if different. - Uninstall the TimescaleDB package
Terminal window sudo dnf remove timescaledb-2-postgresql-18Replace
18with your PostgreSQL version if different. - Remove the TimescaleDB repository configuration
Terminal window sudo rm /etc/yum.repos.d/timescale_timescaledb.repo - Remove dependencies
Remove unused dependencies installed with TimescaleDB:
WarningThis step may also remove PostgreSQL as a dependency.
Terminal window sudo dnf autoremove
- Drop the TimescaleDB extension from your databases
-
Connect to each database where TimescaleDB is enabled and remove the extension:
Terminal window sudo -u postgres psql -d <database_name> -
At the
psqlprompt:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /var/lib/pgsql/18/data/postgresql.confPress
/to search, typeshared_preload_libraries, and press Enter. Pressito edit. Find the line withshared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. PressEsc, then type:wqand press Enter to save. - Restart PostgreSQL
Terminal window sudo systemctl restart postgresql-18Replace
18with your PostgreSQL version if different. - Uninstall the TimescaleDB package
Terminal window sudo dnf remove timescaledb-2-postgresql-18Replace
18with your PostgreSQL version if different. - Remove the TimescaleDB repository configuration
Terminal window sudo rm /etc/yum.repos.d/timescale_timescaledb.repo - Remove dependencies
Remove unused dependencies installed with TimescaleDB:
WarningThis step may also remove PostgreSQL as a dependency.
Terminal window sudo dnf autoremove
Uninstall self-hosted TimescaleDB with Homebrew or MacPorts.
- Drop the TimescaleDB extension from your databases
At the
psqlprompt, remove the TimescaleDB extension:DROP EXTENSION timescaledb CASCADE;Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q. - Remove TimescaleDB from shared_preload_libraries
Edit the PostgreSQL configuration file:
Terminal window sudo vi /opt/homebrew/var/postgresql@17/postgresql.confFind the line with
shared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. - Restart PostgreSQL
Terminal window brew services restart postgresql@17 - Uninstall TimescaleDB
Terminal window brew uninstall timescaledb-tools timescaledb - Remove all the dependencies and related files
Terminal window brew untap timescale/tap
- Drop the TimescaleDB extension from your databases
At the
psqlprompt, remove the TimescaleDB extension:DROP EXTENSION timescaledb CASCADE; - Remove TimescaleDB from shared_preload_libraries
At the command prompt, remove
timescaledbfromshared_preload_librariesin thepostgresql.confconfiguration file:Terminal window nano /opt/homebrew/var/postgresql@14/postgresql.confshared_preload_libraries = '' - Save the changes to the postgresql.conf file
- Restart PostgreSQL
Terminal window port reload postgresql - Uninstall TimescaleDB and the related dependencies
Terminal window port uninstall timescaledb --follow-dependencies
If you installed TimescaleDB on Windows using a package manager, you can uninstall it without removing PostgreSQL.
- Drop the TimescaleDB extension from your databases
-
Open Command Prompt or PowerShell and connect to each database where TimescaleDB is enabled:
Terminal window psql -U postgres -d <database_name> -
At the
psqlprompt, remove the extension:DROP EXTENSION timescaledb CASCADE;
Repeat this for all databases with TimescaleDB enabled. To exit psql, type
\q.WarningUsing
CASCADEwill drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep. -
- Remove TimescaleDB from shared_preload_libraries
-
Open your PostgreSQL configuration file. The default location is:
C:\Program Files\PostgreSQL\<version>\data\postgresql.confYou may need to run the editor as Administrator.
-
Find the line with
shared_preload_librariesand removetimescaledbfrom the list. For example, change:shared_preload_libraries = 'timescaledb'to:
shared_preload_libraries = ''If there are other extensions in the list, keep them and only remove
timescaledb. -
Save the file.
-
- Restart PostgreSQL
Terminal window Restart-Service postgresql-x64-18Replace
18with your PostgreSQL version if different. - Remove TimescaleDB binaries
Manually remove the TimescaleDB files from your PostgreSQL installation directory.
-
Remove TimescaleDB library files. You may need to run PowerShell as Administrator:
Terminal window Remove-Item "C:\Program Files\PostgreSQL\18\lib\timescaledb*.dll"Replace
18with your PostgreSQL version if different. -
Remove TimescaleDB extension files:
Terminal window Remove-Item -Recurse "C:\Program Files\PostgreSQL\18\share\extension\timescaledb*"Replace
18with your PostgreSQL version if different.
NoteIf you encounter permission errors, ensure you’re running PowerShell as Administrator.
-