Thread: 127.0.0.1 or localhost

127.0.0.1 or localhost

From
PG Doc comments form
Date:
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. ??

Re: 127.0.0.1 or localhost

From
Tom Lane
Date:
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