Re: On Ubuntu 12.04 i do have two psql one of those isn't working

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Yvon Thoraval <yvon(dot)thoraval(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: On Ubuntu 12.04 i do have two psql one of those isn't working
Date: 2012-09-17 07:47:07
Message-ID: 5056D57B.3020506@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Guettler 2012-09-17 08:07:18 Slow counting still true?
Previous Message Albe Laurenz 2012-09-17 07:38:06 Re: application for postgres Log