127.0.0.1 or localhost
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/9.5/libpq-pgpass.html
Description:
Hi All,
It's not actually a problem, it's a question. pgpass in my case, has two
lines, one with 127.0.0.1 and another with localhost
what would be the difference from one to another. ??
PG Doc comments form <noreply@postgresql.org> writes:
It's not actually a problem, it's a question. pgpass in my case, has two
lines, one with 127.0.0.1 and another with localhost
what would be the difference from one to another. ??
AFAIR, the field is matched to how you wrote the hostname in the
connection parameters.
Also, it looks like there's a special case to consider 'localhost'
as matching a Unix-socket connection, if the socket is in the
installation's default socket directory.
regards, tom lane