How to manually configure and start PostgreSQL on windows? How to manually configure and start PostgreSQL on windows? windows windows

How to manually configure and start PostgreSQL on windows?


use pgsql bundle zip so u know actual path that not requires installation

initialize database

initdb.exe <datafolderpath>

init.db & pg_ctl is under

pgsql/bin

start database

"pg_ctl" -D "<datafolderpath>" -l logfile start


In addition to what Nirmal wrote, what I usually do:

  • Download the ZIP distribution from http://www.enterprisedb.com/products/pgbindownload.do
  • Unzip the archive
  • Run initdb specifying the location of the desired data directory (note this should not reside in c:\Program Files as that is not writeable for a regular user. You should create this e.g. in %APPDATA%
  • After initdb has finished, adjust settings in (the generated) postgresql.conf (e.g. shared memory, listen addres, log settings and such). I do this using search & replace.
  • The start the server using pg_ctl as mentioned by Nirmal (and described in the manual).
  • Make sure you start PostgreSQL using the same (Windows) user that you used when running initdb to avoid problems with file permissions!
  • You can use pg_ctl register ... to create a Windows service to automatically start Postgres.