Install and configure TimescaleDB on Postgres
This section shows you how to install the latest version of Postgres and TimescaleDB on a supported platform using source supplied by Tiger Data.
Install the latest Postgres source
At the command prompt, clone the TimescaleDB GitHub repository:
Change into the cloned directory:
Checkout the latest release. You can find the latest release tag on our [Releases page][gh-releases]:
This command produces an error that you are now in detached head state. It is expected behavior, and it occurs because you have checked out a tag, and not a branch. Continue with the steps in this procedure as normal.
Build the source
Bootstrap the build system:
For installation on Microsoft Windows, you might need to add the pg_config and cmake file locations to your path. In the Windows Search tool, search for system environment variables. The path for pg_config should be C:\Program Files\PostgreSQL\<version>\bin. The path for cmake is within the Visual Studio directory.
Build the extension:
Install TimescaleDB
Configure Postgres
If you have more than one version of Postgres installed, TimescaleDB can only be associated with one of them. The TimescaleDB build scripts use pg_config to find out where Postgres stores its extension files, so you can use pg_config to find out which Postgres installation TimescaleDB is using.
Locate the
postgresql.confconfiguration file:Open the
postgresql.conffile and updateshared_preload_librariesto:
If you use other preloaded libraries, make sure they are comma separated.
- Tune your Postgres instance for TimescaleDB
This script is included with the timescaledb-tools package when you install TimescaleDB. For more information, see [configuration][config].
Restart the Postgres instance:
Set the user password
Log in to Postgres as
postgres
You are in the psql shell.
- Set the password for
postgres
When you have set the password, type \q to exit psql.