Re: remapped localhost causes connections to localhost to fail using Postgres

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: remapped localhost causes connections to localhost to fail using Postgres
Дата
Msg-id 20151204171638.98ff11e91957357099ece0b4@potentialtech.com
обсуждение исходный текст
Ответ на remapped localhost causes connections to localhost to fail using Postgres  (Dann Corbit <DCorbit@connx.com>)
Список pgsql-hackers
On Fri, 4 Dec 2015 21:55:23 +0000
Dann Corbit <DCorbit@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dann Corbit
Дата:
Сообщение: remapped localhost causes connections to localhost to fail using Postgres
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: Size of Path nodes