Skip to main content

Installing PostgreSQL and TimescaleDB in Windows

Install PostgreSQL

  1. Download Postgres
  2. Run the installer and install with defaults except StackBuilder as it's not needed.
  3. Next, edit the security configuration file pg_hba.conf:

    C:\Program Files\PostgreSQL\17\data\pg_hba.conf

    After the line that reads:

    host    all     all             127.0.0.1/32            scram-sha-256

    Add the following line to allow other IPs besides localhost to access the server:

    host    all     all             0.0.0.0/0              scram-sha-256

Install TimescaleDB

TimescaleDB is an extension for PostgreSQL database. Follow the installation guide below for getting the extension installed on your computer.

Installation Guide and Download

  1. Download TimescaleDB installer zip file and extract the timescaledb folder to the desktop.

  2. Add Postgres file path to system environment variables.

    1. Search Environment Variables and click Edit the system environment variables

    2. When the system properties windows comes up, make sure it's on the Advanced tab and click the Environment Variables button.

    3. Click on the Path variable in the System variables table and click the Edit... button.

    4. Double-click the next empty row in the table and paste in the path to the bin folder in the PostgreSQL installation folder.

      Example path:

      C:\Program Files\PostgreSQL\17\bin
    5. Click OK.

    6. Try running pg_config from a command line to confirm the path is working.
  3. Stop the PostgreSQL service. 

    net stop postgresql-x64-17
  4. Right click on setup.exe within the extracted TimescaleDB folder and click Run as administrator. A command prompt will appear.

  5. Press n to skip tuning the PostgresDB installation

  6. Open a command prompt inside the installer folder and at the command prompt, run the following command using the appropriate PostgreSQL data path and hit enter

    Example command line to append configuration to the end of the exising configuration:

    timescaledb-tune --quiet --yes --dry-run >> "C:\Program Files\PostgreSQL\17\data"

    Example command line to update the PostgreSQL configuration:

    timescaledb-tune --quiet --yes "--conf-path=C:\Program Files\PostgreSQL\17\data"
  7. An alternative is to run the entire setup unattended with the following command line with administrator privileges for PostgreSQL 17:
    setup -wait-before-exit=false -yes-tune -tune-conf-path "C:\Program Files\PostgreSQL\17\data" -tune-flags --yes
  8. If the installation is not successful due to an "access denied" error, make sure you ran the setup.exe as administrator.
  9. Start the PostgreSQL service:
    net start postgresql-x64-17
Configuring PostgreSQL, TimescaleDB and Ignition as your Historian

Follow the guide here to configure everything for Ignition: Using PostgreSQL and TimescaleDB with Ignition