Access PostgreSQL from the outside world

Writing by on Tuesday, 7 of September , 2010 at 4:07 pm

Say you want to open up PGSQL so an external client can access it, maybe make some JDBC calls from a different machine etc. you will need to slightly modify some config files

  • vi /opt/local/pgsql/data/postgresql.conf
  • Change listen_addresses = ‘*’
  • vi /opt/local/pgsql/data/pg_hba.conf
  • Search for something like
    • host all all 127.0.0.1/32 md5
  • Add a new line below
    • host all all 10.4.5.6/32 trust
    • Note 10.4.5.6 is the IP address of the client you want to connect from
  • Restart pgsql process /etc/init.d/postgresql restart

Leave a comment

Category: Tips and Tricks

No Comments

No comments yet.

Leave a comment

You must be logged in to post a comment.

Shivdev Kalambi's Blog

Shivdev Kalambi is a Software Development Manager, previously a Principal Software Engineer at ArcSight/HP. With over 16 years' experience in software development, he's worked on several technologies and played different roles and contributed to all phases of projects. Non-tech activies include Ping-pong, Rock Climbing and Yoga at PG, Golf, Skiing, Swimming & a beer enthusiast.