2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018

06/28/2006: Postgresql; Connecting to PostgreSQL from a remote client.

I see many web pages that mention the pg_hba.conf file which control which hosts and user can connect to which database. However, there is a listen_addresses parameter in postgresql.conf which needs to be set. By default, it was commented out so that no remote client connections could be made - certainly a reasonable security precaution.

In order to accept connections from remote client you need to set the listen_addresses parameter to something other than localhost. For example, if your PostgreSQL server sits on then that could be the value for listen_addresses. If your PostgreSQL server has multiple addresses, you could use * so that remote clients can connect to any of the IP addresses. Or use a comma-delimited list if only some of the IP address should be used when connecting to PostgreSQL.

subscribe via RSS