Timescale

check retention policies

SELECT j.hypertable_name,
       j.job_id,
       config,
       schedule_interval,
       job_status,
       last_run_status,
       last_run_started_at,
       js.next_start,
       total_runs,
       total_successes,
       total_failures
  FROM timescaledb_information.jobs j
  JOIN timescaledb_information.job_stats js
    ON j.job_id = js.job_id
  WHERE j.proc_name = 'policy_retention';

short

SELECT hypertable_name,config FROM timescaledb_information.jobs;

show all hypertables

SELECT * FROM timescaledb_information.hypertables;

Create retention policy

SELECT add_retention_policy('tablename', INTERVAL '14 days');

hypertables sorted by size

SELECT hypertable_name, hypertable_size(format('%I.%I', hypertable_schema, hypertable_name)::regclass)
  FROM timescaledb_information.hypertables order by hypertable_size DESC;

Check which extentions are installed/enabled

\dx
                                      List of installed extensions
    Name     | Version |   Schema   |                            Description
-------------+---------+------------+-------------------------------------------------------------------
 plpgsql     | 1.0     | pg_catalog | PL/pgSQL procedural language
 timescaledb | 2.3.1   | public     | Enables scalable inserts and complex queries for time-series data
(2 rows)

pg_stat_statements extention

SELECT *
FROM pg_available_extensions
WHERE
    name = 'pg_stat_statements' and
    installed_version is not null;
CREATE EXTENSION pg_stat_statements;

in config

shared_preload_libraries = 'timescaledb, pg_stat_statements'