Perform this procedure for each PostgreSQL instance that you created in Installing and Configuring PostgreSQL. During the verification you will complete the PostgreSQL postinstallation steps.
Determine whether you are in a local zone or in a global zone. If you are in a failover zone, use /postgres instead of /global/postgres for your directory prefix in this procedure.
Switch to the PostgreSQL user if necessary.
# su - postgres |
(Optional) Set the PATH and LD_LIBRARY_PATH variables.
$ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin $ export PATH $ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib: $ export LD_LIBRARY_PATH |
Set the PGDATA variable.
The PGDATA variable points to the directory where the PostgreSQL database cluster is installed. The PostgreSQL database cluster is a directory that contains the configuration and the data files for all the databases.
$ PGDATA=/global/postgres/data $ export PGDATA |
Create the data directory and the logs directory.
$ mkdir /global/postgres/data $ mkdir /global/postgres/logs |
Initialize the PostgreSQL cluster.
$ cd ~/postgres-version $ ./bin/initdb -D $PGDATA |
Start the PostgreSQL database server.
$ ./bin/pg_ctl -l /global/postgres/logs/firstlog start |
Create and delete a test database.
$ ./bin/createdb test $ ./bin/dropdb test |
If you are in a non global zone, leave this zone and return to the target zone.