Skip to content

Administrative functions

Administration functions help you manage your service before and after recovery, as well as keeping track of your data

Administrative APIs help you prepare a database before and after a restore event. They also help you keep track of your TimescaleDB setup data.

Before restoring a database backup, prepare the database:

SELECT timescaledb_pre_restore();

Then perform your restore operation:

Terminal window
psql -d your_database < backup.sql

After restoring a database backup, complete the restore:

SELECT timescaledb_post_restore();

Check what telemetry data is being collected and sent:

SELECT get_telemetry_report();

Complete workflow for backing up and restoring a TimescaleDB database:

Terminal window
# On source database
psql -d source_db -c "SELECT timescaledb_pre_restore();"
pg_dump -Fc -f backup.dump source_db
# On target database
createdb target_db
psql -d target_db -c "CREATE EXTENSION IF NOT EXISTS timescaledb;"
psql -d target_db -c "SELECT timescaledb_pre_restore();"
pg_restore -d target_db backup.dump
psql -d target_db -c "SELECT timescaledb_post_restore();"

Check TimescaleDB version and installation

Section titled “Check TimescaleDB version and installation”

Verify the TimescaleDB extension is installed and check version:

SELECT default_version, installed_version
FROM pg_available_extensions
WHERE name = 'timescaledb';
SELECT extversion
FROM pg_extension
WHERE extname = 'timescaledb';

To help when asking for support and reporting bugs, TimescaleDB includes an SQL dump script. It outputs metadata from the internal TimescaleDB tables, along with version information.

This script is available in the source distribution in scripts/. To use it, run:

Terminal window
psql [your connect flags] -d your_timescale_db < dump_meta_data.sql > dumpfile.txt

Inspect dumpfile.txt before sending it together with a bug report or support question.