Re: On Ubuntu 12.04 i do have two psql one of those isn't working - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: On Ubuntu 12.04 i do have two psql one of those isn't working
Date
Msg-id 5056D57B.3020506@iol.ie
Whole thread Raw
In response to On Ubuntu 12.04 i do have two psql one of those isn't working  (Yvon Thoraval <yvon.thoraval@gmail.com>)
Responses Re: On Ubuntu 12.04 i do have two psql one of those isn't working
List pgsql-general
On 17/09/2012 07:15, Yvon Thoraval wrote:
>
> I'm testing my second PostgreSQL install on Xunutu 12.04 after a disk crash.
>
> Everything went well using command line where i was able, after config
> and setup, to log into a db using :
> $ psql <IPV4 or IPV6 of the server> -U yt -d yt_tests
>
> Then i wanted to test postgres thru php where i got Http error 500.
>
> After that i discovered that i do have TWO psql installed :
>
> the first :
> lrwxrwxrwx 1 root root 37 mars   6  2012 /usr/bin/psql ->
> ../share/postgresql-common/pg_wrapper
>
> the second :
> -rwxr-xr-x 1 root root 433224 août  17 00:58
> /usr/lib/postgresql/9.1/bin/psql

The first isn't a "real" psql - it's a symlink to pg_wrapper, which is
how Debian and Ubuntu allow you to run different Postgres versions and
clusters on the same machine. You call the client program (psql,
pg_dump, etc) you want as usual, but pass it the --cluster option, as
follows:

  psql --cluster 9.1/main (....)

and then pg_wrapper calls the correct version of the client program.


>
> then, i wonder how to workaround this "installation bugg" because i
> suspect php is using the second not working psql where the first is the
> one being in my PATH.

PHP doesn't use psql, it uses libpq (the client library).

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: application for postgres Log
Next
From: Thomas Guettler
Date:
Subject: Slow counting still true?