Install PostgreSQL Command-line tools on Windows

EnterpriseDB (the official provider of Windows binaries) offers standalone ZIP files containing everything you need. This requires no installation wizard and leaves your Windows Registry clean.

1.Download the Binaries:Takes 1 min.

Go to the EnterpriseDB Windows Binaries Download Page. Choose your preferred PostgreSQL version and click the download link next to Windows x86-64.

2.Extract the Folder:Takes 1 min.

Extract the downloaded ZIP file. Inside, you will see a pgsql folder. Move this folder somewhere permanent, like C:\pgsql. Your CLI tools sit right inside C:\pgsql\bin.

3.Add to System PATH:Takes 2 min.

To run tools like psql from any command prompt, add it to your environment variables:

  1. Search for “Environment Variables” in the Windows Start menu.

  2. Click Environment Variables… at the bottom.

  3. Under System variables, select Path and click Edit….

  4. Click New and paste your bin path: C:\pgsql\bin.

  5. Click OK on all windows to save.

4.Verify Installation:Takes 30 seconds.

Open a completely new Command Prompt (cmd) or PowerShell terminal and verify it works by typing:

psql --version
pg_dump --version