Skip to main content

PostgreSQL + TimescaleDB Installation Guide (Windows)

Target environment: Windows 10/11 development machine

SoftwareRecommended VersionNotes
PostgreSQL17 (latest stable)PG 18 is Beta, not recommended
TimescaleDB2.24+Supports PG 15/16/17

TimescaleDB will drop PG 15 support in June 2026; new projects should use PG 16+.


Installation Steps

1. Install PostgreSQL

  1. Go to https://www.postgresql.org/download/windows/
  2. Click Download the installer (provided by EDB)
  3. Download PostgreSQL 17 Windows x86-64 version
  4. Run the installer with the following settings:
StepSetting
Installation DirectoryDefault C:\Program Files\PostgreSQL\17
ComponentsCheck all (PostgreSQL Server, pgAdmin 4, Stack Builder, Command Line Tools)
Data DirectoryDefault C:\Program Files\PostgreSQL\17\data
PasswordSet superuser (postgres) password — make sure to remember it
Port5432 (default)
LocaleDefault locale
  1. After installation, do not check Launch Stack Builder — click Finish directly

2. Add to PATH

Open PowerShell as Administrator and run:

[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "Machine") + ";C:\Program Files\PostgreSQL\17\bin", "Machine")

Reopen the PowerShell window and verify:

psql --version

Should display psql (PostgreSQL) 17.x.

3. Install TimescaleDB

  1. Go to https://docs.timescale.com/self-hosted/latest/install/installation-windows/
  2. Download the Windows installer (.exe) for PostgreSQL 17
  3. Right-click → Run as administrator (important — otherwise it will fail to write to the lib/ directory due to permissions)
  4. The installer will auto-detect the PostgreSQL path
  5. When asked whether to run timescaledb-tune, select y
  6. When asked for the postgresql.conf path, enter:
    C:\Program Files\PostgreSQL\17\data\postgresql.conf
  7. Accept all subsequent optimization suggestions with y

Note: If not run as administrator, you will get an Access is denied error and the DLL files cannot be copied.

4. Restart PostgreSQL Service

Run as Administrator:

net stop postgresql-x64-17
net start postgresql-x64-17

5. Verify Installation

psql -U postgres -c "SELECT version();"

After entering the password, you should see PostgreSQL 17.x version information.


Create Project Database

Each project uses an independent database, isolated from each other.

Jope-PLC-Monitor

psql -U postgres

CREATE DATABASE jope_plc_monitor;
\c jope_plc_monitor
CREATE EXTENSION IF NOT EXISTS timescaledb;
\dx

\dx should show the timescaledb extension as enabled. Type \q to exit.

Verification:

psql -U postgres -d jope_plc_monitor -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'timescaledb';"

Future New Projects

CREATE DATABASE {project_name};
\c {project_name}
CREATE EXTENSION IF NOT EXISTS timescaledb; -- Only for projects requiring time-series functionality

Connection Information

ItemValue
Hostlocalhost
Port5432
Usernamepostgres
PasswordPassword set during installation
Management ToolpgAdmin 4 (found in the Start menu)

Connection String Example (.NET)

Host=localhost;Port=5432;Database=jope_plc_monitor;Username=postgres;Password={your_password}

Multi-Project Isolation

PostgreSQL Server (localhost:5432)
├── DB: jope_plc_monitor ← PLC-Monitor dedicated
├── DB: project_b ← Future project B
└── DB: project_c ← Future project C
  • Tables, schemas, and extensions are completely isolated between different databases
  • TimescaleDB Extension must be enabled individually in each database that needs it
  • All projects share the same PostgreSQL Server, using only one port