The example instructions in Installing and Configuring PostgreSQL on Shared Storage in a Non-Global Failover Zone install the PostgreSQL software on shared cluster storage. You can also install this software into the default directory /usr/local/pgsql by following the instructions in this section.
To install the PostgreSQL software in the default directory, perform the steps provided in the following example procedures:
Example: Building and Installing the PostgreSQL Software in the Default Directory in a Failover Zone
Example: Enabling the PostgreSQL Software to Run in the Cluster
This example illustrates how to install the PostgreSQL software in the default directory /usr/local/pgsql. You can also build and install the PostgreSQL binaries on shared storage. See Installing and Configuring PostgreSQL on Shared Storage in a Non-Global Failover Zone.
You can only install the PostgreSQL software in the default directory if one of the following conditions is true:
/usr is not inherited
/usr/local/pgsql is linked to somewhere in the global zone
If /usr/local/pgsql is linked to the global zone, create this directory in the non-global zone as well.
Log in as the PostgreSQL user.
zone# su - postgres |
Create the directory in the non-global zone.
zone$ mkdir /pgsql-linksource |
Expand the software tar file.
zone$ gzcat /tmp/postgresql-8.1.0.tar.gz |tar xvf - |
Add the C compiler and ar to your PATH.
zone$ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin zone$ export PATH |
Add the C compiler and readline libraries to your LD_LIBRARY_PATH.
zone$ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib:/opt/csw/lib zone$ export LD_LIBRARY_PATH |
Install the source and configure the build.
zone$ gzcat /tmp/postgresql-8.1.0.tar.gz |tar xvf - zone$ cd /global/mnt3/postgres/build/postgresql-8.1.0 zone$ ./configure |
Build the PostgreSQL binaries.
zone$ gmake |
If you use gcc to build the postgres binaries, build them in a failover file system.
Run the PostgreSQL regression tests.
zone$ gmake check |
Switch to the root user.
zone$ su |
Add the C compiler and ar to your PATH.
This example assumes the following:
The compiler is gcc, located in /usr/sfw/bin.
ar is located in /usr/ccs/bin.
zone# PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin zone# export PATH |
Add the C compiler and readline libraries to your LD_LIBRARY_PATH.
zone# LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib:/opt/csw/lib zone# export LD_LIBRARY_PATH |
Install the binaries.
zone# gmake install |
Exit from root access.
zone$ exit |
Clean the distribution.
zone# gmake clean |
Perform the steps in Example: Enabling the PostgreSQL Software to Run in the Cluster to complete installation and configuration of PostgreSQL.