Обсуждение: Running postgresql on localhost

Поиск
Список
Период
Сортировка

Running postgresql on localhost

От
chrisstrachan@msn.com (chrisstrachan_at_msn.com)
Дата:
Hi everyone,

Probably a bit of a basic config problem but any help would be really
appreciated

I can currently log in fine to psql like so,

#psql template1 -p 5432

this by default logs you into the local socket but unfortuanately it
does not work when I try

#psql template1 -h localhost

and returns the error

psql: unknown host name: localhost  ( a similar login with mysql works
fine )

This has been quite frustrating as it means I can't login to the
database with tools such as pgadmin


Thanks in advance

Chris Strachan
chrisstrachan at msn.com

Re: Running postgresql on localhost

От
Tom Lane
Дата:
chrisstrachan@msn.com (chrisstrachan_at_msn.com) writes:
> I can currently log in fine to psql like so,
> #psql template1 -p 5432
> this by default logs you into the local socket but unfortuanately it
> does not work when I try
> #psql template1 -h localhost
> psql: unknown host name: localhost

You have a broken name lookup setup --- either /etc/hosts is wrong,
or you've misconfigured DNS, or quite likely both.  It's not
Postgres-specific.

            regards, tom lane