Installing PostGIS without admin privileges on Windows 7

  1. Create folder “C:\UserData\markhamf\pgsql” to hold database files
  2. Extract postgresql binaries from to c:\bin\pgsql
  3. In a cmd.exe console:
    1. Change to install dir: cd c:\bin\pgsql\bin
    2. Create new database under user markhamf: initdb.exe -D C:\UserData\markhamf\pgsql
    3. Start db server under local user account: pg_ctl start -D C:\UserData\markhamf\pgsql
    4. Install PL/pgsql language into default template: createlang plpgsql template1
    5. Create PostGIS enabled template: createdb postgistemplate
  4. Download PostGIS from Extract binaries into the existing postgresql directory structure at C:\bin\pgsql
  5. Return to cmd.exe console in c:\bin\pgsql\bin:
    1. Install PostGIS functions into postgis template:
      psql -d postgistemplate -f ..\share\contrib\postgis-1.5\postgis.sql
      psql -d postgistemplate -f ..\share\contrib\postgis-1.5\spatial_ref_sys.sql
      psql -d postgistemplate -f ..\share\contrib\postgis-1.5\postgis_comments.sql
    2. Test install was correct: psql -d postgistemplate -c "SELECT postgis_full_version();"
    3. Create a spatially enabled database from the template: createdb -T postgistemplate gisdb
  6. Test connection with pgAdmin3, and verify that you can connect, and that gisdb is visible. Use the following parameters for a new connection (leave others as default):
    Name: gisdb
    Host: localhost
    Username: markhamf
  7. Add Start Menu shortcuts for:
    C:\bin\pgsql\bin\pg_ctl.exe start -D C:\UserData\markhamf\pgsql
  8. Optionally, addC:\bin\pgsql\bin to the Path environmental variable

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s

%d bloggers like this: