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

Samples

Prepare database for restore

Before restoring a database backup, prepare the database:
SELECT timescaledb_pre_restore();
Then perform your restore operation:
psql -d your_database < backup.sql

Complete restore operation

After restoring a database backup, complete the restore:
SELECT timescaledb_post_restore();

View telemetry report

Check what telemetry data is being collected and sent:
SELECT get_telemetry_report();

Full backup and restore workflow

Complete workflow for backing up and restoring a TimescaleDB database:
# 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

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';

Dump TimescaleDB meta data

To help when asking for support and reporting bugs, includes an SQL dump script. It outputs metadata from the internal tables, along with version information. This script is available in the source distribution in scripts/. To use it, run:
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.

Available functions