Re: Connecting via localhost pg-8.0.3 - Mailing list pgsql-admin

From Tom Lane
Subject Re: Connecting via localhost pg-8.0.3
Date
Msg-id 10056.1118894915@sss.pgh.pa.us
Whole thread Raw
In response to Re: Connecting via localhost pg-8.0.3  (David <dbree@duo-county.com>)
Responses $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"  (Bill Hernandez <pgsql@mac-specialist.com>)
Re: Connecting via localhost pg-8.0.3  (David <dbree@duo-county.com>)
List pgsql-admin
David <dbree@duo-county.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

pgsql-admin by date:

Previous
From: Postgres Admin
Date:
Subject: PostgreSQL and Delphi 6
Next
From: Bill Hernandez
Date:
Subject: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"