Skip to main content

Posts

Showing posts from December, 2006

Installing PostgreSQL on Linux

Recently I had to install postgresql on a linux machine. I ended up referring to more than one article on the web. So here's an attempt to capture all in one document. 1. Download latest postgresql-XXX.tar.gz (where XXX is a release number) distribution of postgres database. At the time of writing this document 8.2 is the latest release. 2. Due to built-in security reasons, postgres cannot run as a root user. Therefore, become a superuser and create a postgres group. Then add a user postgres to the group as follows; sudo su - root (become a superuser) groupadd postgres (create a postgres group) useradd postgres –g postgres (create a postgres user) 3. Extract the tar file into /usr/local directory. This should create a postgresql-XXX subdirectory in /usr/local. cd /usr/local gunzip -c /path-to-file/postgresql-XXX.tar.gz | tar xvf - 4. create a /usr/local/pgsql directory where postgres database will be installed. mkdir /usr/local/pgsql 5. Assign ownership of di