Skip to content. | Skip to navigation

Navigation

Personal tools

Development Applications

Perl, CVS, Databases, that sort of stuff

PostgreSQL

PostgreSQL should be the defacto open source database as it is ACID compliant. However, an awful lot of stuff is MySQL friendly.

Note

As of, at least, Solaris 11 build 59, Sun supply PostgreSQL in /usr/bin.

Note

We need to bodge the build to find the readline libraries in /opt/sfw.

Build and Install

cd .../postgresql-8.1.0

LDFLAGS=-R/opt/sfw/lib ./configure --prefix=/usr/local/${PWD##*/} --with-includes=/opt/sfw/include --with-libraries=/opt/sfw/lib
make
make install

Post-Install

su
groupadd postgres
useradd -g postgres -d /var/pgsl postgres
passwd -l postgres

mkdir -p /var/pgsql/data
chown -R postgres /var/pgsql

Create the initial database files:

su - postgres
/usr/local/postgresql-8.1.0/bin/initdb -D /var/pgsql/data

Create an init.d script:

cat <<EOF > /etc/init.d/pgsql
#! /bin/sh

su - postgres -c "/usr/local/${PWD##*/}/bin/pg_ctl -D /var/pgsql/data -l /var/pgsql/pgsql.log \$1"
EOF
chmod a+x /etc/init.d/pgsql
ln /etc/init.d/pgsql /etc/rc3.d/S50pgsql
ln /etc/init.d/pgsql /etc/rc3.d/K50pgsql

Document Actions