I get this when using a script that is attempting to use connect to the PostgreSQL database.

install_driver(Pg) failed: Can't load '/usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBD/Pg/Pg.so' for module DBD:g: libpq.so.3: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.7/i686-linux/DynaLoader.pm line 230.
at (eval 46) line 3
Compilation failed in require at (eval 46) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /home/myuser/myuser/mgmt/perl/Directory/Database.pm line 129


I'm using Postgresql 8.1.4

pg_hba.conf

Code:
local   all         all                               trust
host    all         all         127.0.0.1/32          trust
host    all         all         ::1/128               trust

I installed perl module DBD:PG, recompiled apache again (of course with postgresql)...same error.

root@server [~]# locate libpq.so
/usr/local/cpanel/lib/libpq.so.3
/usr/local/cpanel/lib/libpq.so.2
/usr/lib/libpq.so.4
/usr/lib/libpq.so.4.1
/usr/lib/libpq.so


root@server [~]# perl /home/myuser/user/main/portal.pl
Segmentation fault (core dumped)

I got that after running this:
cp /usr/local/cpanel/lib/libpq.so.3 /usr/lib
service postgresql restart