Re: Connecting via localhost pg-8.0.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David <dbree(at)duo-county(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Connecting via localhost pg-8.0.3
Date: 2005-06-16 04:08:35
Message-ID: 10056.1118894915@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

David <dbree(at)duo-county(dot)com> writes:
> Well, you guessed correctly. It was a configuration problem. By
> inserting the line:
> unix_socket_directory = '/var/run/postgresql'
> into postgresql.conf, it works as expected.

Well, you've still got an issue here somewhere, because if your server
and client libraries came from the same build then they ought to agree
on this without any help from the config file. AFAIK, Debian hasn't
changed their policy about where to put the socket, so it seems like you
must be using a server that didn't come from Debian.

> I must confess that I was a bit unclear about the connection parameters.
> I thought that (in php) "host=localhost" meant to use sockets, but this
> means connect through TCP/IP over lo, correct?

Correct --- "localhost" is an IP-ism referring to TCP loopback
connections. In the Unix-socket world there is no name for the local
machine at all, since that is the whole universe anyway ... all you
need for that is a filesystem pathname.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bill Hernandez 2005-06-16 04:58:11 $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"
Previous Message Postgres Admin 2005-06-16 03:49:29 PostgreSQL and Delphi 6