I use Postgres.app to manage PostgreSQL on my Mac. I wanted to install Timescaledb locally and ran into few issues while installing it which are discussed in this post.
Timescaledb is an open-source database built for analyzing time-series data which is built on top of PostgreSQL.
Timescaledb allows installation on OS X via two mechanisms - via Source and via Homebrew. If we are using PostgreSQL managed by Homebrew then we can install Timescaledb also via Homebrew. But if we want to use Timescaledb along with Postgres.app then we have to install it via Source as per Timescaledb documentation.
Before starting the installation make sure that the pg_config
path is using the path of pg_config
utility installed by Postgres.app. This can be verified by running following command.
The easiest way to install PostgreSQL on a Mac is by installing Postgres.app. Postgres.app is a full-featured PostgreSQL installation packaged as a standard Mac application.
If the output is something else, then follow the instructions here to setup the CLI utilities installed by Postgres.app properly.
Now it is time to start installing Timescaledb. First we need to download the source code and switch to appropriate stable release tag for installation.
This results in following error.
We can resolve it as follows.
Running this shows up another error.
The pg_isolation_regress
is a binary from PostgreSQL which does not get built in a normal PostgreSQL build. We have to build it ourself if we want to run the isolation regression tests. As we don't want to do that we can skip it as mentioned in the above error message.
If it runs successfully then it will print following at the end.
We can go ahead and run the next command.
After this, we need to edit the postgresql.conf
to add timescaledb
to shared_preload_libraries
.
Then uncomment the line with shared_preload_libraries
and change it to following.
After that we have to restart PostgreSQL. If it restarts successfully, the installation is successful. If not we can check the errors as follows.
After successful restart, we can start psql
and add the timescaledb
extension to our database.
And that's all. Timescaledb is setup properly running with PostgreSQL managed by Postgres.app.