Configure and Run PostgreSQL 8.2 in Local Zone – Solaris 10 U4

Solaris 10 U4 is shipped with PostgreSQL 8.2. If you need to enable it, so here are the steps to enable PostgreSQL in local zone on Solaris 10 U4.

  1. Create sparse zone
  2. Login to that zone
  3. Do the following steps to initialize PostgreSQL database:
    • As root su to postgres user:
        # su - postgres
    • Create PostgreSQL DB:
        $ /usr/postgres/8.2/bin/initdb -D /var/postgres/8.2/data
    • As root, use the SMF’s svcadm command to start PostgreSQL
        # /usr/sbin/svcadm enable postgresql:version_82

If you need to enable your PostgreSQL become able to remotes through TCP/IP connection then you need to do the following steps:

  1. Edit /var/postgres/8.2/data/pg_hba.conf
    • Add additional lines that represents your requirements. Follow the instruction and sample inside that file.
  2. Edit /var/postgres/8.2/data/postgresql.conf
    • Edit default value listen_addresses = 'localhost' to become listen_addresses = '*' or to specific host according to your requirements.
  3. Restart your PostgreSQL
    • # /usr/sbin/svcadm restart postgresql:version_82

To test the TCP/IP connection you can use psql command as following:
# psql -h <hostname> -U <database username> -d <database name>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: