Update TimescaleDB versions
Update your TimescaleDB version with an in-place update. By updating in-place, you don't need to dump and restore your data. Automated migration scripts handle conversion of internal states where needed.
Make upgrades automatic
Timescale Cloud avoids the manual work involved in updating your TimescaleDB version. Updates take place automatically during a maintenance window picked by you. Learn more about automatic version updates in Timescale Cloud.
important
Follow these instructions to update TimescaleDB within the same major release version. For example, you can update from TimescaleDB 2.1 to 2.2, or from 1.7 to 1.7.4. To update from 1.x to 2.x, see the section on updating to TimescaleDB 2.x.
TimescaleDB release compatibility
TimescaleDB supports the following PostgreSQL releases. If you aren't running a compatible release, update PostgreSQL before updating TimescaleDB. To learn more, see the sections on updating PostgreSQL in Timescale Cloud, Managed Service for TimescaleDB, and self-hosted TimescaleDB.
TimescaleDB release | Supported PostgreSQL releases |
---|---|
1.7 | 9.6, 10, 11, 12 |
2.0 | 11, 12 |
2.1-2.3 | 11, 12, 13 |
2.4 | 12, 13 |
2.5+ | 12, 13, 14 |
important
To make sure your update completes properly, update PostgreSQL and TimescaleDB separately. Keep PostgreSQL and TimescaleDB versions compatible throughout the process. If your update spans multiple versions, this could require several steps.
For example, if you're currently running PostgreSQL 10 and TimescaleDB 1.7.5, and you want to update to PostgreSQL 13 and TimescaleDB 2.2:
- Upgrade PostgreSQL 10 to PostgreSQL 12
- Update TimescaleDB 1.7.5 to TimescaleDB 2.2 on PostgreSQL 12
- Upgrade PostgreSQL 12 to PostgreSQL 13 with TimescaleDB 2.2 installed
Update TimescaleDB
Update TimescaleDB by using PostgreSQL's ALTER EXTENSION
command. You can run
different TimescaleDB versions on different databases within the same PostgreSQL
instance. You can also update your extensions independently on different
databases.
important
Before updating, check the release notes for the version you want to update to. Specific versions might have different update requirements that add additional steps.
Updating TimescaleDB
Install the latest version of the TimescaleDB extension.
Connect to your database with a PostgreSQL client. This example uses
psql
, but any client works. If you're usingpsql
, connect with the-X
flag. This prevents any commands in.psqlrc
from loading a previous TimescaleDB version on session startup.psql -X "postgres://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>?sslmode=require"
Do not run any other commands before continuing to the next step.
At the
psql
prompt, upgrade TimescaleDB to the latest installed version:ALTER EXTENSION timescaledb UPDATE;
This upgrades TimescaleDB to the latest installed version, even if you're several versions behind. To update to a version that's not the latest installed version, specify the version number, like this:
ALTER EXTENSION timescaledb UPDATE TO '2.5.1';
Verify that the upgrade worked by running
\dx timescaledb
to see the version number of the extension.\dx timescaledb Name | Version | Schema | Description ------------+---------+------------+--------------------------------------------------------------------- timescaledb | x.y.z | public | Enables scalable inserts and complex queries for time-series data (1 row)
Downgrade TimescaleDB
If you encounter a problem immediately after upgrading, you can roll back your upgrade. To learn more, see the section on downgrading TimescaleDB.
Found an issue on this page?
Report an issue!