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

From: Arcady Genkin <a(dot)genkin(at)utoronto(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgres-general <pgsql-general(at)postgresql(dot)org>
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: 2001-06-14 17:02:58
Message-ID: r1zy9qv570d.fsf@gnu.cdf.toronto.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Arcady Genkin <a(dot)genkin(at)utoronto(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-06-15 02:51:14 can not create database!!!!
Previous Message Kristis Makris 2001-06-14 15:37:37 Re: Re: [BUGS] ODBC Interface version 07_01_0005, problem with C++ exceptions

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2001-06-14 17:17:35 Re: Unique rows without a key
Previous Message Peter Eisentraut 2001-06-14 16:34:55 Re: stopping execution of a script (on error)