Connection problems with "psql -h localhost postgres"

Поиск
Список
Период
Сортировка
От Wayne Pierce
Тема Connection problems with "psql -h localhost postgres"
Дата
Msg-id 4617fd6d0505020603749c0188@mail.gmail.com
обсуждение исходный текст
Ответы Re: [despammed] Connection problems with "psql -h localhost postgres"  (Andreas Kretschmer <akretschmer@despammed.com>)
Re: Connection problems with "psql -h localhost postgres"  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Connection problems with "psql -h localhost postgres"  (Ennio-Sr <nasr.laili@tin.it>)
Список pgsql-novice
I have PostgreSQL setup and everything is working fine when I use
"psql -d <dbName>" on the command line or when I use mod_python to
connect.  However I when I use "psql -h localhost <dbName> postgres" I
get the following error:

psql: could not connect to server: Connection refused
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?

I have the following lines in my pg_ident.conf and pg_hba.conf files:

-- pg_ident.conf --
# MAPNAME     IDENT-USERNAME    PG-USERNAME
localhost       all             all
host            all             all

-- pg_hba.conf --
# TYPE  DATABASE    USER        IP-ADDRESS/CIDR    METHOD
# IPv4-style local connections:
host       all       all         0.0.0.0 0.0.0.0         trust
host       all       all         127.0.0.1/32            trust
#host       logs    postgres      127.0.0.1/32       trust
#hostnossl   all      all         10.1.100.143/32    trust

# Using sockets credentials for improved security. Not available everywhere,
# but works on Linux, *BSD (and probably some others)
local      all       all                                 trust

I have tried various combinations, but nothing works.  I have tried
setting tcpip_socket in $PGDATA/postgresql.conf to 'true' and 'false'
with a restart each time.

The reason I need this to work is Ruby on Rails, for some reason rails
connects with the command line option above.  I have no idea why it
will work on way but not another.  I have tried to turn off IDENT
authentication completely (I am the only one with an account on this
system and the only one interacting directly with the database).

Does anyone know how to fix this?  I didn't find too much in the
mailing lists on using the -h option.

Thanks for any suggestions or help,

Wayne

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

Предыдущее
От: Ennio-Sr
Дата:
Сообщение: psql: Is it possible to run a query from a *sql file?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: psql: Is it possible to run a query from a *sql file?