timescaledb

How do you install timescaledb on MAC OS M1 (apple Silicone) if you have the postgress.app installed


Edit: I know it’s easier using homebrew if you have postgres installed via homebrew, but i wanted to keep my Postgress.app setup for other reasons

How do you install timescaledb on Apple Sillicone M1 Chip?

I am getting this error

tsdb=# CREATE EXTENSION IF NOT EXISTS timescaledb;
ERROR:  could not open extension control file "/Applications/Postgres.app/Contents/Versions/14/share/postgresql/extension/timescaledb.control": No such file or directory

After following instructions on

https://docs.timescale.com/install/latest/self-hosted/installation-macos/#install-self-hosted-timescaledb-using-homebrew


Solution

  • This question was not on Stack Overflow So I decided to ask it and answer it

    Step 1: Make sure you have the latest postgress.app installed

    You need to have at least postgres v14 of the postgress.app, if you dont you will get this error

    ld: can't link with a main executable file '/Applications/Postgres.app/Contents/Versions/13/bin/postgres' for architecture arm64
    

    because older versions used only intel

    Step 2: Follow the instructions for homebrew

    Use the instructions here

    but when you get to this step timescaledb-tune --quiet --yes you start following my isntructions

    Step 3: My instructions

    step 3.1

    Since the homebrew method expects to use homebrew postgres you have to point the tune command to postgress.app config file instead by running this

    timescaledb-tune --yes --conf-path="/Users/tawanda/Library/Application Support/Postgres/var-14/postgresql.conf"

    replace var-14 with your version of postgres if later

    step 3.2

    manually run your own setup as below because the script that comes with timescale wont work for your posgresss.app use case

    /usr/bin/install -c -m 755 $(find /opt/homebrew/Cellar/timescaledb/2.7.2/lib/timescaledb/postgresql/ -name "timescaledb*.so")  /Applications/Postgres.app/Contents/Versions/14/lib/postgresql
    
    /usr/bin/install -c -m 644 /opt/homebrew/Cellar/timescaledb/2.7.2/share/timescaledb/* /Applications/Postgres.app/Contents/Versions/14/share/postgresql/extension/
    

    replace version 14 and version 2.7.2 with your postgress and timescale versions respectively if later

    step3.3

    initialise the extension

    tawanda=# CREATE database tsdb;
        
    tawanda=# \c tsdb;
    
    tsdb=# CREATE EXTENSION IF NOT EXISTS timescaledb;
    WARNING:
    WELCOME TO
     _____ _                               _     ____________
    |_   _(_)                             | |    |  _  \ ___ \
      | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
      | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
      | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
      |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
                   Running version 2.7.2
    For more information on TimescaleDB, please visit the following links:
    
     1. Getting started: https://docs.timescale.com/timescaledb/latest/getting-started
     2. API reference documentation: https://docs.timescale.com/api/latest
     3. How TimescaleDB is designed: https://docs.timescale.com/timescaledb/latest/overview/core-concepts
    
    Note: TimescaleDB collects anonymous reports to better understand and assist our users.
    For more information and how to disable, please see our docs https://docs.timescale.com/timescaledb/latest/how-to-guides/configuration/telemetry.
    
    CREATE EXTENSION