PostgreSQL pg_hba.conf Issue PostgreSQL pg_hba.conf Issue postgresql postgresql

PostgreSQL pg_hba.conf Issue


This is the issue of PostgreSQL installations on Windows computers having IPv6 enabled. Temporary workaround would be passing paramter "-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


This has been answered by other user here, but I want to show the answer here to make more clear for others:

In pg_hba.conf, add your ipv6 address like this:

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

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


Note that the interface enumeration code that samehost and samenet rely on is very platform-dependent. (There are currently 5 separate implementations for different platforms.) So what works for one setup might not work somewhere else.

That said, the analogous 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 appropriately.

So it's conceivable that the interface enumeration code in Windows somehow fails to include the link-local addresses.

If you have isolated this problem enough, I would send a bug report to PostgreSQL to analyze the issue further.