This Postgres extension contains support functions to improve the performance of Promscale.
Promscale 0.11.0 and higher require that the Promscale extension is installed. Check the release notes for more details.
To run the extension:
- PostgreSQL version 12 or newer.
To compile the extension (see instructions below):
- Rust compiler
- PGX framework
You can install the Promscale extension using precompiled packages for Debian and RedHat-based distributions (RHEL-7 only).
The packages can be found in the Timescale repository.
While the extension declares a dependency on Postgres 12-14, it can be run on TimescaleDB 2.x as well, which fulfills the requirement on Postgres indirectly. You can find the installation instructions for TimescaleDB here
-
Install Postgres or TimescaleDB Instructions for installing TimescaleDB and Postgres can be found here, and here respectively.
-
Install the Promscale extension
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - apt update apt install promscale-extension-postgresql-14
See the Postgres documentation for more information.
-
Install TimescaleDB or Postgres Instructions for installing TimescaleDB and Postgres can be found here, and here respectively.
-
Install the extension (on CentOS 7)
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{centos})-x86_64/pgdg-redhat-repo-latest.noarch.rpm tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL [timescale_timescaledb] name=timescale_timescaledb baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 EOL yum update yum install -y promscale-extension-postgresql-14
- Official HA. This very image is available at Timescale Cloud. They are updated along with tagged releases.
- HA-based CI image - used in the GitHub Actions CI pipeline. Use at your own peril. It could be handy to play with pre-release versions.
alpine
- legacy and local development -- Avoid if you can. It will eat yourlaundrycollation.quick
and package building images are not published anywhere and are used for local development and building packages
The extension is installed by default on the
timescaledev/promscale-extension:latest-pg12
docker image.
For bare-metal installations, the full instructions for setting up PostgreSQL, TimescaleDB, and the Promscale Extension are:
- Install some necessary dependencies
sudo apt-get install -y wget curl gnupg2 lsb-release
- Add the PostgreSQL APT repository (Ubuntu)
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -c -s)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- Add the TimescaleDB APT repository
echo "deb [signed-by=/usr/share/keyrings/timescale.keyring] https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/timescale.keyring
- Install PostgreSQL with TimescaleDB
sudo apt-get update sudo apt-get install -y timescaledb-2-postgresql-14
- Tune the PostgreSQL installation
sudo timescaledb-tune --quiet --yes sudo service postgresql restart
- Install dependencies for the PGX framework and promscale_extension
sudo apt-get install -y build-essential clang libssl-dev pkg-config libreadline-dev zlib1g-dev postgresql-server-dev-14
- Install rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env
- Install the PGX framework
cargo install cargo-pgx --git https://github.com/timescale/pgx --branch promscale-staging
- Initialize the PGX framework using the PostgreSQL 14 installation
cargo pgx init --pg14=/usr/lib/postgresql/14/bin/pg_config
- Download this repo and change directory into it
sudo apt-get install -y git git clone https://github.com/timescale/promscale_extension cd promscale_extension git checkout 0.5.0
- Compile and install
make package sudo make install
- Create a PostgreSQL user and database for promscale (use an appropriate password!)
sudo -u postgres psql -c "CREATE USER promscale SUPERUSER PASSWORD 'promscale';" sudo -u postgres psql -c "CREATE DATABASE promscale OWNER promscale;"
- Download and run promscale (it will install the extension in the PostgreSQL database)
LATEST_VERSION=$(curl -s https://api.github.com/repos/timescale/promscale/releases/latest | grep "tag_name" | cut -d'"' -f4) curl -L -o promscale "https://github.com/timescale/promscale/releases/download/${LATEST_VERSION}/promscale_${LATEST_VERSION}_Linux_x86_64" chmod +x promscale ./promscale --db-name promscale --db-password promscale --db-user promscale --db-ssl-mode allow --install-extensions
This extension will be created via CREATE EXTENSION
automatically by the Promscale connector and should not be created manually.
cargo: No such file or directory
means the Rust compiler is not installed
To understand more about how to write SQL migration files for this extension, consult this guide.