DEV Community

Cover image for Up and running with TimescaleDB
Ali Raza
Ali Raza

Posted on • Edited on

Up and running with TimescaleDB

I've been getting into time-series databases over the past few months. I got into playing with TimescaleDB and was super impressed with its capabilities. One of the important things to understand is that TimescaleDB is just Postgres at its core which means technically TimescaleDB is an extension. Following is my usual MO to quickly run an instance of TimescaleDB.

Getting a docker container up:

docker run -d --name timescaledb -p 5434:5434 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg11
Enter fullscreen mode Exit fullscreen mode

Connecting to said docker container:

docker exec -it timescaledb psql -U postgres

Enter fullscreen mode Exit fullscreen mode

Creating your database:

CREATE database tstutorial;

Enter fullscreen mode Exit fullscreen mode

Connecting to your new database:

\c tstutorial
Enter fullscreen mode Exit fullscreen mode

Adding the TimescaleDB extension:

CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;

Enter fullscreen mode Exit fullscreen mode

That's it! Now you have a dockerized TimescaleDB instance up and running.

Top comments (1)

Collapse
 
hasanmehmood profile image
Hassan Mehmood

Good read! and a quick way to start with TimescaleDB.