Re: PHP's pg_connect() and non-standard location of the socket (was: REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432) - Mailing list pgsql-general

From Arcady Genkin
Subject Re: PHP's pg_connect() and non-standard location of the socket (was: REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432)
Date
Msg-id r1zy9qv570d.fsf@gnu.cdf.toronto.edu
Whole thread Raw
In response to Re: PHP's pg_connect() and non-standard location of the socket (was: REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Arcady Genkin <a.genkin@utoronto.ca> writes:
> >> They're not, unless you tell them, which is why runtime setting of the
> >> parameter isn't all that useful IMHO.  But some people wanted it, so
> >> there it is.
>
> > Hmm...  How would I tell that to `psql'?  Via "-v" parameter?
>
> IIRC, a hostname parameter that starts with '/' is now interpreted as
> a socket path.  So you'd do psql -h /path/to/something, or set PGHOST,
> to inform the client about a nonstandard socket location.
>
> $ psql -h /nowhere -p 7654
> psql: connectDBStart() -- connect() failed: No such file or directory
>         Is the postmaster running locally
>         and accepting connections on Unix socket '/nowhere/.s.PGSQL.7654'?

Cool!  Thanks a lot.  Just changed the location of the socket to
/var/run, and my PHP script was able to connect using "host=/var/run"
string.

Thanks very much once more.
--
Arcady Genkin
i=1; while 1, hilb(i); i=i+1; end

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: stopping execution of a script (on error)
Next
From: Peter Maas
Date:
Subject: JDBC PostgreSQL 7.1.2