Recent

Author Topic: Can not load PostgreSQL Client libpq.so  (Read 24616 times)

99Percent

  • Full Member
  • ***
  • Posts: 160
Can not load PostgreSQL Client libpq.so
« on: September 20, 2011, 11:01:09 pm »
I can run my Lazarus program fine in my development machine, but when I move my executable to another computer I get:

Can not load PostgreSQL client. Is it Installed? (libpq.so)

I have tried almost everything I can think of to get it working to no avail incluiding a copying the libpq.so file on the same directory, recreating the library directory structure the same as in my development computer (it is /usr/local/pgsql/lib vs /opt/PostgreSQL/9.1/lib), adding symlinks all over, adding the library path to the PATH environment variable.

pgadmin3 works fine on the target computer, so I am at my wits end. Please help.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11449
  • FPC developer.
Re: Can not load PostgreSQL Client libpq.so
« Reply #1 on: September 20, 2011, 11:30:54 pm »
So, where is your libpq.so ?  Is your library in the LD_LIBRARY_PATH environment or listed in /etc/ld.so.conf?

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: Can not load PostgreSQL Client libpq.so
« Reply #2 on: September 21, 2011, 03:09:15 pm »
Lazarus Postgre component depends on libpq. libpq depends on other libraries. Have not looked into the the required libraries for libpq 9.1 yet. If you figure them out I would be interested to know what they are.

If pgAdmin works then that suggests all the required libs are already installed somewhere.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #3 on: September 21, 2011, 04:04:49 pm »
So, where is your libpq.so ?  Is your library in the LD_LIBRARY_PATH environment or listed in /etc/ld.so.conf?
echo $LD_LIBRARY_PATH returns nothing
my libpq.so is anywhere I want it, with the same result
if I add text file indicating the directory of the library files for /etc/ld.so.d is useless

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #4 on: September 21, 2011, 04:05:47 pm »
debian x64

cpalx

  • Hero Member
  • *****
  • Posts: 753
Re: Can not load PostgreSQL Client libpq.so
« Reply #5 on: September 21, 2011, 04:22:04 pm »
install libpq-dev

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #6 on: September 21, 2011, 09:22:41 pm »
install libpq-dev
it will install 8.4 no matter?

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #7 on: September 21, 2011, 09:57:17 pm »
I installed libpq-dev anyway and that did the trick. I would like to know what the hell it fixed though, because obviously this is not the right way.

Silvio Clécio

  • Guest
Re: Can not load PostgreSQL Client libpq.so
« Reply #8 on: September 21, 2011, 10:30:19 pm »
Hi,

Is SQLdb compatible with PG 64 on 64 platform?

Thx.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #9 on: September 21, 2011, 11:31:05 pm »
Hi,

Is SQLdb compatible with PG 64 on 64 platform?

Thx.
yes, it works fine

Silvio Clécio

  • Guest
Re: Can not load PostgreSQL Client libpq.so
« Reply #10 on: September 21, 2011, 11:37:49 pm »
Really?  :o thank you guy.

After this news, I'll retire the Zeos.

Thanks again.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can not load PostgreSQL Client libpq.so
« Reply #11 on: September 22, 2011, 12:55:00 am »
That is good, I never liked Zeos, its just too big.

Hopefully soon someone will make a direct TPQConnection that doesn't require libpq.so or libpq.dll

jixian.yang

  • Full Member
  • ***
  • Posts: 173
Re: Can not load PostgreSQL Client libpq.so
« Reply #12 on: September 22, 2011, 10:06:18 am »
Maybe there should be a light database package.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can not load PostgreSQL Client libpq.so
« Reply #13 on: September 22, 2011, 10:59:50 am »
I installed libpq-dev anyway and that did the trick. I would like to know what the hell it fixed though, because obviously this is not the right way.

Actually, I think that's the proper way: use your distribution's package manager to install the database client library package.

If you distribute your application in a .deb or. rpm, you can specify this package as a dependency...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

cpalx

  • Hero Member
  • *****
  • Posts: 753
Re: Can not load PostgreSQL Client libpq.so
« Reply #14 on: September 22, 2011, 04:35:52 pm »
when you install libpq, you have the library: /usr/lib/libpq.so-XX, and lazarus needs libpq.so, so you have to alternatives
1. make the simbolik link
2. Install libpq-dev to isntall the source and it makes the simbolik link

 

TinyPortal © 2005-2018