Re: : Unable to load libsqlpg.so

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Carlos Ojea Castro <carlosojea(at)leveltelecom(dot)es>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: : Unable to load libsqlpg.so
Date: 2004-11-03 13:50:09
Message-ID: 1099489809.28319.182.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2004-11-03 at 12:56 +0100, Carlos Ojea Castro wrote:
> > I'm trying to use kylix3 and postgresql 7.4.1.
> >
> > My distro was Debian Woody, kernel 2.20.
> > I make the link /usr/local/pgsql/lib/libpq.so pointing to libpq.so.2.2
> > and connection with my database get fine.
> >
> > But now, using Debian Sarge Testing, kernel 2.4.27 (I tried also with
> > kernel 2.6.8-1) that link don't make things work anymore, I get the
> > error 'Unable to load libsqlpg.so' and I cannot connect with my
^^^^^^^^
Did you spell that right? Where does that library come from? It sounds
as if it belongs to some package that calls Pg; it isn't part of Pg
itself.

> > postgresql database.
> >
> > Anyone knows how can I make my connection work again?
> >
> > Thank you,
> > Carlos
> >
> Finally I get the connection working in Debian Sarge, kernel 2.4.27
> doing this:
> 1.- Install libpgsql2.7.2.1-2woody6_i386.deb

I presume you mean libpgsql2-7.2.1-2woody6_i386.deb. This is the
libpq.so.2 library from PostgreSQL 7.2.1, so it is not very suitable for
7.4. On the other hand, judging by what you write below, you may not
actually be using it.

> 2.- in /usr/local/kylix3/bin make the link: ln -s
> /usr/local/pgsql/lib/libpq.so libpq.so
> 3.- in /usr/local/pgsql/lib make the link: ln -s libpq.so.2.2 libpq.so

That ought to fail if libpq.so is already there, since you aren't using
-f, or have you got the names reversed?

libpq.so is only used for linking into binaries when a program is
compiled; the linked library loaded by a program at runtime is
libpq.so.x, where x is the library major version number. You seem to be
wanting to tell kylix that the libpq.so.2 library is
at /usr/local/pgsql/lib/libpq.so, and at the same time make that a
symbolic link to the libpq.so.3 library.

> However, doing that in Debian Sarge, kernel 2.6.8-1 results in an error
> 'Invalid username/password' when I try to connect to the database.

I think I'm not surprised; I don't know if this error is directly caused
by the library mismatch, but you seem to be going out of your way to
confuse things! You don't mention running ldconfig, so I'm not even
sure which library is going to be called; run ldd on your executable and
see what it says. You might be getting the libpq.so.2 library from the
libpgsql2 package from 7.2.1 and using it to connect to a 7.4 database;
or you might be connecting with a library that is masquerading as
libpq.so.2 but is actually libpq.so.3.

> Any ideas for Debian Sarge, kernel 2.6.8-1?

The kernel version should have nothing to do with it. Library loading
is handled by the C library, libc6 and ldd.so.

My first suggestion is to get a version of Kylix that is built for
PostgreSQL 7.4.

--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"Lo, children are an heritage of the LORD; and the
fruit of the womb is his reward." Psalms 127:3

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2004-11-03 14:17:43 Re: Restricting Postgres
Previous Message Sim Zacks 2004-11-03 13:34:31 autovacuum redhat startup