Translations:PostgreSQL/QuickStart/59/en

From the example above you can see that both an IPv4 and an IPv6 IP address are mapped to localhost. When  refers to this file, it will grab the first match and use that as the address; in this case 127.0.0.1. When PostgreSQL parses this, it will match the IPv6 formatted address as well, e.g. ::ffff:127.0.0.1. If, however, the IPv6 address appears first, then  will map to ::1 alone; ::1 is not the same as ::ffff:127.0.0.1. As such, if you do not have ::1 as a permitted means of access,  will not be able to establish a connection. Furthermore, your kernel needs to support the IPv6 protocol.