PostgreSQL pg_hba.conf Problem

In pg_hba.conf I have

host all all 127.0.0.1/32 md5 host all all samenet md5 

I also added

 host all all samehost md5 

on both.

I am using pgAdminIII, trying to create a "Register a new server". When I connect to (localhost), it works fine. But when I change the host to the actual name of the workstation, it says:

 FATAL: no pg_hba.conf entry for host "fe80::c81c:9e9c:6570:d0bf%20", user "postgres", database "postgres", SSL off 

Additional Information

  • Operating System: Windows 7 Ultimate 32 bit
  • PostgreSQL Server 9.0.2

Any help on this would be greatly appreciated.

+8
postgresql pgadmin
source share
6 answers

This is a problem installing PostgreSQL on computers with IPv6 enabled. A temporary workaround will pass the parameter "-h 127.0.01", as described in this article.

http://postgresql.1045698.n5.nabble.com/FATAL-no-pg-hba-conf-entry-for-host-1-td1873063.html

+6
source share

An answer was given here by another user, but I want to show an answer here to make it more understandable to others:

In pg_hba.conf add the ipv6 address as follows:

 host all all fe80::c81c:9e9c:6570:d0bf/128 md5 

fe80 :: c81c: 9e9c: 6570: d0bf is your ipv6 address.

+4
source share

Note that the interface enumeration code that samehost and samenet on is highly platform dependent. (Currently, there are 5 separate implementations for different platforms.) So, what works for one installation may not work elsewhere.

However, a similar setup works for me on Linux, that is, I can connect to the database server on the local host using

 psql -d postgres -h 'fe80::xxxx:xxxx:xxxx:xxxx%eth0' 

after setting listening_addresses and samenet respectively.

Thus, it can be assumed that the code for enumerating an interface in Windows cannot somehow include local link addresses.

If you sufficiently isolated this problem, I would send a bug report to PostgreSQL for further analysis of the problem.

+3
source share

I had the same problem and it was solved by disabling ipv6 support on both machines. Not sure if this is the option for you.

+1
source share

You can also use

 host all all ::1/128 md5 

for the local host.

+1
source share

Disable IPV6 on adapters you can. After that do

 netsh interface teredo set state disabled 

This will disable virtual network interfaces that you cannot see from the GUI.

0
source share

All Articles