TimescaleDB is a PostgreSQL extension that enables easier approach when working with time-series data. Today we are going to see how can we install, enable / disable, get the TimescaleDB version of the database, and optionally remove it.
Regarding the installation, there are few ways you could do it depending on your needs, and the instructions in the official documentation are pretty good and clear.
Enable TimescaleDB and list versions
Step 1. Login to PostgreSQL.
psql -h some_host -d some_db -U some_username
Step 2. Enable the extension.
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
Note: You could specify version though, by adding
VERSION, for instance:
CREATE EXTENSION IF NOT EXISTS timescaledb VERSION "1.4.2" CASCADE;
Step 3. List installed extension versions.
SELECT default_version, installed_version FROM pg_available_extensions WHERE name = 'timescaledb';
default_version | installed_version -----------------+------------------- 1.4.2 | 1.4.2 (1 row)
default_versionis the server instance / Docker container image version installed.
installed_versionis the version enabled and used by PostgreSQL.
- Sometimes these versions could be different and you may need to upgrade / downgrade.
Remove TimescaleDB extension
DROP EXTENSION IF EXISTS timescaledb;
As always, if you stuck anywhere using the steps above, let me know in the comment section below, no sign up required.
On a side note, follow our official channel on Telegram.