psql does not pick up hostname without -h even though they ae the same

Started by John Griffithsover 22 years ago2 messagesbugs
Jump to latest
#1John Griffiths
griffithsjr@navair.navy.mil

When running psql locally using the tcp connect with tcpip_socket = true and
hostname_lookup = true in postgresql.conf, psql does not find localhost unless
the -h option is specified.

427 bash$ psql
psql: FATAL: No pg_hba.conf entry for host localhost, user jrg4598, database
jrg4598

428 bash$ psql -h localhost
Password:
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

jrg4598=# \q
429 bash$

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: John Griffiths (#1)
Re: psql does not pick up hostname without -h even though they ae the same

John Griffiths <griffithsjr@navair.navy.mil> writes:

When running psql locally using the tcp connect with tcpip_socket = true and
hostname_lookup = true in postgresql.conf, psql does not find localhost unless
the -h option is specified.

I think you've got something weird in your PGHOST environment variable
on the client side.

regards, tom lane