listening on tcp socket instead of unix domain

From: David Bear <David(dot)Bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: listening on tcp socket instead of unix domain
Date: 2005-06-25 17:58:49
Message-ID: 20050625175849.GA18646@asu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hoping to get postgresql to listen on a tcp socket I made the
following change to postgresql.conf:

#listen_addresses = 'localhost' # what IP interface(s) to listen on;
listen_addresses = 'localhost' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any
#port = 5432
port = 5432

I understand this to mean, listen on localhost, ie 127.0.0.1.

However, a netstat -l tells me:

netstat -l | grep 5432
unix 2 [ ACC ] STREAM LISTENING 732094 /tmp/.s.PGSQL.5432

netstat -l | grep postg
tcp 0 0 localhost:postgresql *:* LISTEN
tcp 0 0 localhost:postgresql *:* LISTEN

This doesn't look right. Moreover, when attempting to create an ssh
tunnel to connect to postgres from a windows box, the connection
fails.

Is postgres really listening on a socket that is 'connect-able'
through ssh tunneling? If so, then would using ssh command

ssh -L 5432:remotehost:5432 user(at)remotehost

be sufficient to connect to the postgres running on remote host? This
fails when running psql on the machine with message:

> psql -p 5432
psql: could not connect to server: No such file or directory
...

So, I don't think something is quite working. Please advise.

--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Marek Aleksander Dąbek 2005-06-25 18:44:03 Windows XP installation problem
Previous Message Tom Lane 2005-06-25 17:08:42 Re: pg_dump -Fc does not dump indexes]