O'Reilly logo

PostgreSQL 9 Administration Cookbook - Second Edition by Simon Riggs, Gianni Ciolli, Hannu Krosing, Gabriele Bartolini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling access for network/remote users

PostgreSQL comes in a variety of distributions. In many of these, you will notice that remote access is initially disabled as a security measure.

How to do it…

By default, PostgreSQL gives access to clients who connect using Unix sockets, provided the database user is the same as the system's username. Here, we'll show you how to enable other connections.

Note

In this recipe, we mention configuration files, which can be located as shown in the Finding the current configuration settings recipe in Chapter 3, Configuration.

The steps are as follows:

  1. Add or edit this line in your postgresql.conf file:
    listen_addresses = '*'
  2. Add the following line as the first line of pg_hba.conf to allow access to all databases for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required