wiki:UsersWikiWinCompileInitdb

Version 36 (modified by pracine, 14 years ago) ( diff )

Initialize PostgreSQL cluster and run as server for compiled version

This is still a work in progress Back to windows compile

  1. Create a windows local user called postgres
  1. Initialize the DB cluster from the Msys shell:

    /c/postgres/bin/initdb -U postgres -D /c/postgres/data -A trust
  1. You may want to change the port in the C:/postgres/data/posgresql.conf file (in our case running under 8433 not to conflict with our regular postgres install)
  1. Install as service: (From DOS not MinGW) — note that in this case postgres is a windows account so use the password you specified for the windows account.

    "c:\postgres\bin\pg_ctl" register -N "pgsql-8.3 test" -D "C:\postgres\data" -U postgres -P "somepassword"
  1. Go into the Services panel under windows and start the PostgreSQL service

    1. If your service does not start - check the Windows Event Viewer

    2. You can uninstall the service with:

      "c:\postgres\bin\pg_ctl" unregister -N "pgsql-8.3 test" (this requires a restart)

      A faster way is to stop the service and then from dos:

      sc delete "pgsql-8.3 test"
  1. Before you do a make check for PostGIS, make sure to do an export of PGPORT and other variable to point to the one you are testing (you do this in Msys)

http://www.postgresql.org/docs/8.3/interactive/libpq-envars.html

These are only good for the current session

export PATH="/c/postgres/bin:$PATH"

export PGPORT=8433

export PGUSER=postgres

to see path settings or any other variables at msys prompt

echo ${PATH}

Note: See TracWiki for help on using the wiki.