Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-21-2005, 10:16 AM   #1
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:
use DBI;

@driver_names = DBI->available_drivers;
while($driver=<@driver_names>) {
    print "$driver\n";

So this looks to me like everything should work. But when trying to get a DSN:
$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/' for module DBD::Pg: cannot open shared object file: No such file or dirctory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/ 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 ./ 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 file).
-- I have added the location of the to the file and run ldconfig

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

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
It looks like it can't find -- did your postgres install provide it? Is the library in your LD_LIBRARY_PATH?
Old 11-23-2005, 10:53 AM   #3
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/ file and doing an ldcofig.


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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:08 AM.

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