PostgreSQL Software Installation

Getting free software and installing can sometimes be a daunting
task. Not so with PostgreSQL.

Get the software

The biggest choice you have when getting the software is the
version you want and the machine type you need to install on. As far as machine
type, you really only have a choice of a Unix or Windows platform. Depending on
the platform, you will need to go to either of two places for download.


Getting the PostgreSQL software
is only a few clicks away. If you are installing to a UNIX
operating system, go to
and pick the form you wish. This will pull the latest and greatest version for
you. If you want to get an earlier version, you
should go to,
select one of the mirrors and then choose a version from the source tree. You should end up
with a compressed tar-ball named something similar to


Running PostgreSQL on a windows
machine is not as difficult as some would think. All you really need to do is
go to and get the
Linux-like operating system with all the tools with which
UNIX users are familiar. You must first download the
setup executable
and then run it from windows. This will prompt you for all packages available
along with the PostgreSQL database system.

Install the Software

Installation of the software is quite different depending on
the operating system platform.

Unix Installation Steps

Installation on a UNIX platform reminds me of the old
days when I was installing Oracle. There was a tar-ball and some manual
configuration that needed to be done. It is a far cry from the GUI installation
but the steps involved are quite minimal and just about anyone can follow them.





Postgres user

Create a
Postgres user to manage the software. I named this user postgres


cp postgresql-7.3.4.tar.gz.tgz

copy the
downloaded tar-ball to the /usr/local/src directory



change to the
/usr/local/src directory where you put the tar-ball



decompress the


tar -xvf

Extract the
PostgreSQL source tree


chown -R
postgres.postgres postgresql-7.3.4

Change the
owner of the postgres source tree to the postgres user


su – postgres

Login as the
postgres user to configure and compile



Change to the
root node of the PostgreSQL source tree



Run the
configure command to set up the source tree for the options you want to install.
Here I am configuring with the perl option. See documentation for other
options. If you want to run multiple configure commands make sure you use the
‘gmake clean’ command before issuing the configure command.


gmake check

Runs regression
checks on your configuration to verify the configuration.



Runs the build
procedures and compiles for what you have configured


su – root

Login as root


gmake install

Install your


chown -R
postgres.postgres /usr/local/pgsql

Change the
permissions on the PostgreSQL binary



Modify the
environment variables for everyone




Set the
library path



export PATH

Set the path
for binaries



export MANPATH

Set the path
to the man pages


psql --version

Test to make sure
you can find the binaries. Should get something like: psql (PostgreSQL) 7.3.4

Windows Installation Steps

Many people believe that the installation of PostreSQL on a windows
platform is difficult because PostreSQL was written for a UNIX environment. They feel the
difficulty stems from the fact that they need to first put a Unix-like clone
environment on their
Windows box, and then obtain all the necessary packages, and
string them together somehow. While you do need to install some form of
Unix-like environment on top of Windows, it really is not hard and I believe that most
will enjoy the GUI like nature of this installation over the UNIX type
previously presented. To begin the installation process, run the setup.exe that you downloaded
from the windows
section of getting the software previously in this article.  The following
screen shots represent a typical Cygwin setup.

James Koopmann
James Koopmann
James Koopmann has fourteen years of database design, development and performance tuning experience. In addition, he has extensive database administration experience in Oracle and other relational databases in production environments, specializing in performance tuning of database engines and SQL based applications. Koopmann is an accomplished author with several technical papers in various Oracle related publications such as Oracle Magazine, Oracle Professional and SQL>UPDATE_RMOUG. He is a featured author and database expert for DatabaseJournal, a member of the editorial review committee for Select Journal (The Magazine for the International Oracle Users Group), an Oracle Certified Professional DBA and noted speaker at local Oracle User Groups around the country.

Latest Articles