July 22, 2009

Installing PostgreSQL and PostGIS - Part 1

(This post is all about my Windows XP experience... Note that under normal conditions postgresql installer should work just fine, my situation is an exceptional case, I guess )

I have been trying to install PostGIS. I have encountered some issues which may be helpful for others. I have not yet been successfull, as I will update this post as a log of my status.

Take 1 - Downloaded PosgreSQL 8.4 and installed it. Postgresql comes with a tool called Stack Builder which lets you install additional components. Postgis can be installed this way, they say. I have chosen in the list and saw spatial node. Chose postgis 1.3.6 and a mirror service for download. It downloaded successfully, started installing and bingo, it is not compatible with postgresql 8.4. Then why in the hell is it listed in the stack builder at first place.

Take 2 - Uninstalled 8.4, installed 8.3. Same steps... When I ran Stack Builder I have detected that 8.3 server is not running, erronous installation. Uninstalling again, going thru regedit, deleting all keys for postgresql, and trying to reinstall 8.3. Uhhh, not worked again, I guess I will have to restart $%#$%#$%.


Take 3 - Restarted. No change. Now took a different path. I have downloaded the zip file of the PostgreSQL 8.4.1 and unzipped it.

Creating the database
I have created a database using the command line tool createdb;
createdb deneme

Give full rights to this directory for the user postgresql database will run under(in my case this is the user postgres).

Running postgresql
In standart case postgresql can not be run under administrative user for security reasons. For this reason you should use runas command from the command prompt.
I tried to run the postgresql from command line using the command :
postgres -D ..\data and have encountered an error. -D indicates the data directory for the postgresql.

Tried this instead;
runas /env /user:postgres "postgres -D ..\data".
You can use absolute paths here.

That's all.

Related posts:
[1] Installing PostgreSQL and PostGIS - Part 2 
[2]  Installing PostgreSQL and PostGIS - Part 3

1 comment:

  1. Hello Devrim,

    The PostGIS team at the moment is struggling very hard to release version 1.4.0 of PostGIS. This new version will be compatible with PostgreSQL 8.4 (which has only been released a few weeks ago, on the 1st of July...)

    Many people around the world are waiting eagerly for this release;-)

    I've got good experiences with PostGIS 1.3.6 with PostgreSQL 8.3 - very easy to install with this Stack Builder - in a Windows XP environment. The reason you did not manage might have something to do with the fact that you installed 8.4 first???!

    ReplyDelete