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.
Unix
Getting the PostgreSQL software
is only a few clicks away. If you are installing to a UNIX
operating system, go to http://advocacy.postgresql.org/download/
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 http://www.postgresql.org/mirrors-ftp.html,
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
postgresql-7.3.4.tar.gz.
Windows
Running PostgreSQL on a windows
machine is not as difficult as some would think. All you really need to do is
go to http://cygwin.com/ and get the
Linux-like operating system with all the tools with which
UNIX users are familiar. You must first download the
setup executable http://cygwin.com/setup.exe
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.
Step |
Command |
Description |
1 |
Create |
Create a |
2 |
cp postgresql-7.3.4.tar.gz.tgz |
copy the |
3 |
cd |
change to the |
4 |
unzip |
decompress the |
5 |
tar -xvf |
Extract the |
6 |
chown -R |
Change the |
7 |
su – postgres |
Login as the |
8 |
cd |
Change to the |
9 |
./configure |
Run the |
10 |
gmake check |
Runs regression |
11 |
gmake |
Runs the build |
12 |
su – root |
Login as root |
13 |
gmake install |
Install your |
14 |
chown -R |
Change the |
15 |
vi |
Modify the |
|
LD_LIBRARY_PATH=/usr/local/pgsql/lib export |
Set the |
|
PATH=/usr/local/pgsql/bin:$PATH export PATH |
Set the path |
|
MANPATH=/usr/local/pgsql/man:$MANPATH export MANPATH |
Set the path |
16 |
psql --version |
Test to make sure |
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.