<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> Instalación de WMT

Compiling PostgreSQL 7.3.2 on Solaris 8

The official PostgreSQL 7.3.2 packages for Solaris are built using these instructions.
Required development tools, downloadable from SunFreeware

SMCbc bc 1.06
SMCbison bison 1.875
SMCgcc gcc 2.95.3
SMCgrep grep 2.5
SMClibi libiconv 1.8
SMCm4 m4 1.4
SMCmake make 3.80
SMCzlib zlib 1.14

*******

If you are going to use SSL connections, you should really install the Sun patch that adds the /dev/random and /dev/urandom devices to Solaris.

112438-01.zip Solaris 8 [SPARC]
http://sunsolve.Sun.COM/pub-cgi/patchDownload.pl?target=112438&method=h

112439-01.zip Solaris 8 [INTEL]
http://sunsolve.Sun.COM/pub-cgi/patchDownload.pl?target=112439&method=h

These patches are only necessary for Solaris 8, as Solaris 9 has the /dev/random and /dev/urandom devices built in.

********

Software to be installed:

Readline 4.2a
(ftp://ftp.gnu.org/pub/gnu/readline) o Aquí

OpenSSL 0.9.6i
(http://www.openssl.org/) o Aquí
Tried OpenSSL 0.9.7, but it was broken when trying to compile PostgreSQL with it.

PostgreSQL 7.3.2
(http://www.postgresql.org/) o Aquí

*******

Solaris configuration changes that need to be done

Update the /etc/system file to have decent shared memory and semaphore limits!

If you don't make these changes then reboot (so they become effective), then the PostgreSQL regression tests will fail.

Before you do this, check in your /etc/system file if you already have values for these settings, as sometimes they're created by installing other Solaris packages.

Newly built servers will definitely need these values however.

(These values are copied straight from the PostgreSQL documentation here. They work but may not be optimal).

$ su
# echo set shmsys:shminfo_shmmax=0x2000000 >> /etc/system
# echo set shmsys:shminfo_shmmin=1 >> /etc/system
# echo set shmsys:shminfo_shmmni=256 >> /etc/system
# echo set shmsys:shminfo_shmseg=256 >> /etc/system
# echo set semsys:seminfo_semmap=256 >> /etc/system
# echo set semsys:seminfo_semmni=512 >> /etc/system
# echo set semsys:seminfo_semmsl=32 >> /etc/system
# echo set semsys:seminfo_semmns=512 >> /etc/system

*******

Step by Step instructions


Prepare the general environment
$ su -
Password: [type password here]
# groupadd postgres
# useradd -g postgres -m -d /opt/pgsql -s /bin/sh postgres
# su - postgres
$
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 will 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 o Aquí
# 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.