FAQ

PostgreSQL Windows FAQ — all common questions answered

Quick answers to the most common PostgreSQL questions on Windows: download, psql PATH, service management, remote connections, password reset and backups.

Download & install

What is the latest version of PostgreSQL for Windows?
PostgreSQL 18.3 is the latest stable release (May 2026). Download the official EDB installer from the download page. Always use the latest minor release.
Is PostgreSQL free on Windows?
Yes. PostgreSQL is released under the PostgreSQL License (similar to BSD/MIT) which allows free personal and commercial use without restrictions. The EDB Windows installer is also free.
What is the difference between EDB and the official PostgreSQL installer?
EDB (EnterpriseDB) maintains the official Windows installer available at postgresql.org/download/windows. It is the standard way to install PostgreSQL on Windows and bundles pgAdmin 4 and command-line tools. There is no separate official installer — EDB is the official Windows distribution.
Can I install PostgreSQL without internet access?
Yes. Download the installer on any connected machine, transfer via USB, and run it on the offline machine. The installer is fully self-contained. See Offline installer guide.
Which PostgreSQL version should I install?
For new installations, always install the latest stable release (18.3). If you are upgrading an existing deployment, see Version comparison guide.

psql & PATH

psql is not recognized after installing
Open a new Command Prompt or PowerShell window after install. PATH changes only apply to new terminal sessions. If it still fails, see Fix PATH issues.
Where is psql.exe located on Windows?
Default location: C:\Program Files\PostgreSQL\18\bin\psql.exe. Adjust the version number for 16 or 17.
How do I connect to PostgreSQL with psql?
psql -U postgres connects to the default database. Use psql -U postgres -d mydb -h localhost to specify database and host. See psql commands guide.

Service & port

How do I start and stop the PostgreSQL service on Windows?
net start postgresql-x64-18 to start, net stop postgresql-x64-18 to stop. Or use services.msc. See Windows service guide.
PostgreSQL service fails to start
Check Windows Event Viewer and the PostgreSQL log in the data/log folder. Most common causes: port 5432 already in use, data directory permissions, or stale postmaster.pid. See Service not starting guide.
How do I change the PostgreSQL port from 5432?
Edit postgresql.conf, change port = 5432 to your desired port, restart the service, and update Windows Firewall if needed. See Port 5432 guide.

Remote access

How do I allow remote connections to PostgreSQL on Windows?
Three steps: (1) set listen_addresses = '*' in postgresql.conf, (2) add a host rule in pg_hba.conf, (3) open port 5432 in Windows Firewall. See Remote connections guide.
What is pg_hba.conf and where is it?
pg_hba.conf controls client authentication — who can connect, from where, and how. Default location: C:\Program Files\PostgreSQL\18\data\pg_hba.conf. See Configuration guide.
How do I connect to PostgreSQL from Python on Windows?
Install pip install psycopg2-binary and connect: conn = psycopg2.connect(host='localhost', database='mydb', user='postgres', password='pw'). See Python guide.

Passwords & security

I forgot the postgres superuser password
Reset it via pg_hba.conf trust authentication: stop the service, change pg_hba.conf to trust, start and connect without password, run ALTER USER postgres WITH PASSWORD, restore scram-sha-256. See Password reset guide.
What is the default postgres password after install?
There is no default. The EDB installer requires you to set a password during setup. If you do not remember it, follow the password reset procedure.

Backup & upgrade

How do I back up a PostgreSQL database on Windows?
pg_dump -U postgres -d mydb -F c -f backup.dump backs up one database in compressed format. For all databases: pg_dumpall -U postgres -f all.sql. See Backup guide.
How do I upgrade PostgreSQL on Windows?
Two methods: dump/restore (safer) or pg_upgrade (faster for large databases). Always back up before upgrading. See Upgrade guide.
How do I uninstall PostgreSQL completely?
Stop the service, uninstall via Settings > Apps, then manually delete the data directory to free disk space. See Uninstall guide.

Ready to get started?

Download the official PostgreSQL installer for Windows 10 and 11.

Download guide