1. Mac Postgresql
  2. Install Psql Mac
  3. Postgres App Mac
  4. Mac Postgres App
  5. Mac Psql

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.

Prerequisite

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.

Mac Postgresql

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.

  1. Installing Timescaledb on Mac OS X with Postgres.app. 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.
  2. The easiest way to install Postgres on a Mac is to visit the Postgres.app downloads page and get the latest stable version of PostgreSQL as a DMG interactive installer. Once the download is complete, navigate to your Downloads directory in a Finder window and then double-click on.
  3. In Terminal run the following command to install PostgreSQL on Mac using Homebrew. $ brew install postgres We can check the version of PostgreSQL using the psql command. $ psql -version psql (PostgreSQL) 11.5 Start PostgreSQL. To start PostgreSQL run the following command in the Terminal. $ brew services start postgres We will get a similar.
  4. Postgres.app is a simple, native macOS app that runs in the menubar without the need of an installer. Open the app, and you have a PostgreSQL server ready and awaiting new connections. Close the app, and the server shuts down. PostgreSQL can also be installed on macOS using Homebrew. Please see the Homebrew documentation for information on how to install packages.

If the output is something else, then follow the instructions here to setup the CLI utilities installed by Postgres.app properly.

Postgres app mac

Build

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.

Client

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.

Install Psql Mac

If it runs successfully then it will print following at the end.

Install

Postgres App Mac

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.

Mac Postgres App

After that we have to restart PostgreSQL. If it restarts successfully, the installation is successful. If not we can check the errors as follows.

Mac Psql

After successful restart, we can start psql and add the timescaledb extension to our database.

App

And that's all. Timescaledb is setup properly running with PostgreSQL managed by Postgres.app.