LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-21-2005, 10:16 AM   #1
TheMeteorPolice
LQ Newbie
 
Registered: Oct 2005
Location: USA
Distribution: Fedora Core
Posts: 5

Rep: Reputation: 0
Perl - DBI PG Installation Problems


Hi everyone,

I am trying to get Perl to connect to my local postgresql installation. Everything is good on the PG side, I can connect, its setup to accept tcp connections, etc.

On the perl side, this code shows that I have DBI and Pg installed:
Code:
#!/usr/bin/perl
use DBI;

@driver_names = DBI->available_drivers;
while($driver=<@driver_names>) {
    print "$driver\n";
}
OUTPUT:
DBM
ExampleP
File
Pg
Proxy
Sponge
mysql


So this looks to me like everything should work. But when trying to get a DSN:
Code:
$dsn="dbi:Pg:dbname=itro;host=localhost;port=5432";
$dbh = DBI->connect($dsn, $user, $password,
    { RaiseError => 1, AutoCommit => 0 });
I get the following error:

install_driver(Pg) failed: Can't load '/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/auto/DBD/Pg/Pg.so' for module DBD::Pg: libpq.so.4: cannot open shared object file: No such file or dirctory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 7) line 3
Compilation failed in require at (eval 7) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./t_psql.pl line 17



Some steps I have taken so far:

-- I have tried to reinstall the DBD:Pg module, and it seems to go fine, but the errors above persist.
-- I have tried running the test script above as root as well as a normal user. (so I dont think its a permissions issue getting to the Pg.so file).
-- I have added the location of the Pg.so to the ld.so.conf file and run ldconfig

Thanks in advance for any help or insight!
 
Old 11-22-2005, 07:53 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,118

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
It looks like it can't find libpq.so.4 -- did your postgres install provide it? Is the library in your LD_LIBRARY_PATH?
 
Old 11-23-2005, 10:53 AM   #3
TheMeteorPolice
LQ Newbie
 
Registered: Oct 2005
Location: USA
Distribution: Fedora Core
Posts: 5

Original Poster
Rep: Reputation: 0
oh my god you are so right. I cant believe I missed that!!!!! Sometimes its the little things.

Thank you very much it works perfectly after adding /usr/local/pgsql/lib to the /etc/ld.so.conf file and doing an ldcofig.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Perl DBI question GoTrolling Linux - Newbie 1 03-21-2007 04:31 AM
Mysql reading via Perl DBI ivanatora Programming 2 03-21-2007 04:03 AM
DBI perl "insert" problems Xris718 Programming 3 02-09-2005 03:33 PM
perl | DBI->connect | RHEL AS 3 kaN5300 Linux - Enterprise 6 09-14-2004 08:15 AM
perl DBI prepare question mrtwice Programming 1 10-30-2003 02:12 PM


All times are GMT -5. The time now is 09:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration