Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

This page is user contributed documentation. See the bottom of the page for information about the author.  

Compiling PostgreSQL 7.3.2 on Solaris 8

Set the environment variables for installing Readline $ unset LD_LIBRARY_PATH LD_RUN_PATH

$ PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin

$ LD_OPTIONS='-R$ORIGIN/../lib'

On SPARC boxes, leave out the -march=i586 and -mcpu=i686 options. $ CFLAGS='-O2 -march=i586 -mcpu=i686 -I/opt/pgsql/include'

$ CPPFLAGS='-O2 -march=i586 -mcpu=i686 -I/opt/pgsql/include'



$ export CFLAGS CPPFLAGS LD_OPTIONS PATH

Extract, compile and install Readline $ gunzip readline-4.2a.tar.gz

$ tar xfp readline-4.2a.tar

$ cd readline-4.2a

$ ./configure --prefix=/opt/pgsql

$ make shared

$ make install-shared

$ cd ..

The environment variables for installing Readline are fine for installing OpenSSL too, so extract, compile and install it: $ gunzip openssl-0.9.6h.tar.gz

$ tar xfp openssl-0.9.6h.tar

$ cd openssl-0.9.6h

$ ./config --prefix=/opt/pgsql threads shared

$ make

$ make test

$ make install

$ cd ..

The environment variables for comping and installing PostgreSQL need to be a bit different, so change these now: $ LD_OPTIONS='-L/opt/pgsql/lib -R$ORIGIN/../lib -R/opt/pgsql/lib -i -s -z origin'

On SPARC boxes, leave out the -march=i586 and -mcpu=i686 options. $ CFLAGS=`getconf LFS_CFLAGS`' -O2 -march=i586 -mcpu=i686 -funroll-loops -fexpensive-optimizations -I/opt/pgsql/include'

$ CPPFLAGS=`getconf LFS_CFLAGS`' -O2 -march=i586 -mcpu=i686 -funroll-loops -fexpensive-optimizations -I/opt/pgsql/include'



$ export CFLAGS CPPFLAGS LD_OPTIONS

Extract and compile PostgreSQL: $ gunzip postgresql-7.3.2.tar.gz

$ tar xfp postgresql-7.3.2.tar

$ cd postgresql-7.3.2

$ ./configure --prefix=/opt/pgsql --with-openssl

$ make

$ make check

The "GEOMETRY" test may slightly fail here, so you should check the src/test/regress/regression.diffs file just to ensure the only differences are in a very, very small decimal point and not something significant. This kind of extremely small difference is generally acceptable. Now install it: $ make install

$ make install-all-headers

Set the PostgreSQL environment variables in the profile of the "postgres" user: $ echo 'PGHOME=/opt/pgsql' > /opt/pgsql/.profile

$ echo 'PATH=$PGHOME/bin:$PATH' >> /opt/pgsql/.profile

$ echo 'PGDATA=$PGHOME/data' >> /opt/pgsql/.profile

$ echo 'export PGHOME PATH PGDATA' >> /opt/pgsql/.profile

Initialise the database: $ cd

$ . .profile

$ initdb

$ exit

#

Install the PostgreSQL startup script from:



http://techdocs.postgresql.org/scripts/732solaris8-startup # cp 732solaris8-startup /etc/init.d/pgsql

# ln /etc/init.d/pgsql /etc/rc3.d/S05pgsql

# ln /etc/init.d/pgsql /etc/rc0.d/K30pgsql

As a note, you shouldn't have to add any of the PostgreSQL directories to LD_LIBRARY_PATH for the client applications to work.



For any users that need to use PostgreSQL on the locally installed server, you will have to add the /opt/pgsql/bin directory to their PATH.



The most important thing to do after compiling and installing PostgreSQL, is to tune it's memory settings. Otherwise it will be memory starved and perform very poorly.



For further assistance, my company Digital Distribution GFS Pty. Ltd. specialises in tuning PostgreSQL on Solaris SPARC and INTEL servers.
Updated: 2006-11-15 12:40
Author: Robert Treat
Long time PostgreSQL Contributor, Co-Author of Begining PHP and PostgreSQL 8
Version history:
  • 2006-11-15, Robert Treat
  • 2006-04-03, Robert Treat
Operations: Edit Create subpage (Requires community login)

Privacy Policy | Project hosted by hub.org | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group