Turns out, that my assumption was wrong:
SELECT extversion
FROM pg_extension
where extname="timescaledb";
returns the version of the currently connected database.
Here is how we can find out the versions:
SELECT default_version, installed_version FROM pg_available_extensions
where name="timescaledb";
default_version
: is the version installed in the PostgreSQL server instanceinstalled_version
: is the version that the current database is using
Example:
When the extension used by the database is not up-to-date, the versions do not match:
SELECT default_version, installed_version FROM pg_available_extensions
where name="timescaledb";
default_version | installed_version
-----------------+-------------------
1.4.1 | 1.4.0
now update the extension
- connect via
psql -X -U USER -W -D DBNAME
- execute
ALTER EXTENSION timescaledb UPDATE;
- now the versions are the same