Book Image

PostgreSQL for Data Architects

By : Jayadevan M
Book Image

PostgreSQL for Data Architects

By: Jayadevan M

Overview of this book

This book is for developers and data architects who have some exposure to databases. It is assumed that you understand the basic concepts of tables and common database objects, including privileges and security.
Table of Contents (14 chapters)
13
Index

Authentication and permission issues

Once we are past the initial stage, the next set of errors is a result of incorrect or missing entries in pg_hba.conf:, the host-based authentication file found under the data directory. The location/name of the file can be set using the hba_file parameter in postgresql.conf.

The most likely error we will see will be similar to the following:

psql: FATAL:  no pg_hba.conf entry for host "192.168.56.1", user "postgres", database "postgres"

The message mentions a host, a user, and a database. These are precisely the entries we should provide in pg_hba.conf. It has entries similar to the following screenshot:

Authentication and permission issues

The entry marked host can be a hostname, an IP address range or a special keyword.

Note

Note that most of the lines in the screenshot are commented as they begin with #.

We must reload the configuration for the changes to take effect with the following command:

pg_ctl reload

Now, we will be able to connect.

It's possible to...