On Fri, 4 Dec 2015 21:55:23 +0000 Dann Corbit <dcor...@connx.com> wrote:
> Using a Windows computer, editing the file: > C:\WINDOWS\system32\drivers\etc\hosts > the localhost entry was remapped to the machine name by adding the following > line: > 127.0.0.1 <Computer-Name> > > After this change, Postgres would not allow access using the address > localhost. > Only using the machine name to access the database was possible. > Is this by design? > > In other words > psql -h localhost > fails, but: > psql -h <Computer-Name> > succeeds. This has nothing to do with Postgres. This is the behavior of the operating system. I expect that you'll find that no program on the machine is able to connect using the string "localhost" any more. psql is simply using the OS' builtin name resolution, and you told that name resolution that there is no longer a machine named localhost. On posix systems, it's cusomary to put multiple names in the hosts file, localhost included. I expect that Windows is the same, but I haven't used it in so long that I can't be sure. -- Bill Moran -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers