Sun Cluster Data Service for PostgreSQL Guide for Solaris OS

ProcedureExample: Building and Installing the PostgreSQL Software on Shared Storage in an HA Container

This example illustrates how to install the PostgreSQL software on shared storage. You can also build and install the PostgreSQL binaries in the default directory /usr/local/pgsql. See Installing the PostgreSQL Binaries in the Default Directory in an HA Container (Alternative Installation).

  1. Log in to the zone.


    phys-schost-1# zlogin clu1
    
  2. Add the postgres user.


    zone# groupadd -g 1000 postgres
    zone# useradd -g 1000 -u 1006 -d /postgres -m -s /bin/ksh postgres
    
  3. Log in as the PostgreSQL user.


    zone# su - postgres
    
  4. Set up the build environment.

    1. Create a build directory.


      zone$ mkdir build
      zone$ cd build
      
    2. Add the C compiler and ar to your PATH.


      zone PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin
      zone$ export PATH
      
  5. Install the source and configure the build.


    zone$ gzcat /tmp/postgresql-8.1.0.tag.gz | tar xvf -
    zone$ cd /global/mnt3/postgres/build/postgresql-8.1.0
    zone$ ./configure --prefix=/global/mnt3/postgres/postgresql-8.1.0
    
  6. Build the PostgreSQL binaries.


    zone$ gmake
    

    If you use gcc to build the postgres binaries, build them in a failover file system.

  7. Run the PostgreSQL regression tests.


    zone$ gmake check
    
  8. Install the PostgreSQL binaries.


    zone$ gmake install
    
  9. Clean the distribution.


    zone$ gmake clean