gvalentin has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

I have been having trouble installing DBD::Pg both via CPAN shell and from source. I am getting a 255 Error. Here is what I am doing (installing from source):

Before I run perl Makefile.PL I do the following:
DBI_DSN=dbi:Pg:dbname=<database> DBI_USER=<username> DBI_PASS=<password>


Next, I run the following in order:

# perl Makefile.PL # make # make test

Now, "make test" fails with the following error:

make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-signature......WARNING: This key is not certified with a trusted +signature! Primary key fingerprint: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 + 4AC8 t/00-signature......ok t/00basic...........ok 1/3 t/00basic...........NOK 2# Failed test 'use DBD::Pg;' # in t/00basic.t at line 11. # Tried to use 'DBD::Pg'. # Error: Can't load '/root/DBD-Pg-1.49/blib/arch/auto/DBD/Pg/Pg.s +o' for module DBD::Pg: libpq.so.3: cannot open shared object file: No + such file or directory at /usr/lib64/perl5/5.8.6/x86_64-linux-thread +-multi/DynaLoader.pm line 230. # at (eval 6) line 2 # Compilation failed in require at (eval 6) line 2. # BEGIN failed--compilation aborted at t/00basic.t line 11. t/00basic...........ok 3/3# Looks like you failed 1 test of 3. t/00basic...........dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 2 Failed 1/3 tests, 66.67% okay t/01connect.........Use of uninitialized value in concatenation (.) or + string at t/01connect.t line 74. Use of uninitialized value in concatenation (.) or string at t/01conne +ct.t line 74. Use of uninitialized value in concatenation (.) or string at t/01conne +ct.t line 74. Use of uninitialized value in concatenation (.) or string at t/01conne +ct.t line 74. Use of uninitialized value in concatenation (.) or string at t/01conne +ct.t line 74. Use of uninitialized value in concatenation (.) or string at t/01conne +ct.t line 74. # # Program Version # Perl 5.8.6 (linux) # DBD::Pg # PostgreSQL (compiled) # PostgreSQL (target) # PostgreSQL (reported) # Default port # DBI 1.50 # DBI_DSN skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file. t/01constants.......Can't load '/root/DBD-Pg-1.49/blib/arch/auto/DBD/P +g/Pg.so' for module DBD::Pg: libpq.so.3: cannot open shared object fi +le: No such file or directory at /usr/lib64/perl5/5.8.6/x86_64-linux- +thread-multi/DynaLoader.pm line 230. at t/01constants.t line 4 Compilation failed in require at t/01constants.t line 4. BEGIN failed--compilation aborted at t/01constants.t line 4. # Looks like your test died before it could output anything. t/01constants.......dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-28 Failed 28/28 tests, 0.00% okay t/01setup...........skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file. t/02attribs.........skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/03dbmethod........Can't load '/root/DBD-Pg-1.49/blib/arch/auto/DBD/P +g/Pg.so' for module DBD::Pg: libpq.so.3: cannot open shared object fi +le: No such file or directory at /usr/lib64/perl5/5.8.6/x86_64-linux- +thread-multi/DynaLoader.pm line 230. at t/03dbmethod.t line 16 Compilation failed in require at t/03dbmethod.t line 16. BEGIN failed--compilation aborted at t/03dbmethod.t line 16. # Looks like your test died before it could output anything. t/03dbmethod........dubious Test returned status 255 (wstat 65280, 0xff00) t/03smethod.........skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/04misc............Can't load '/root/DBD-Pg-1.49/blib/arch/auto/DBD/P +g/Pg.so' for module DBD::Pg: libpq.so.3: cannot open shared object fi +le: No such file or directory at /usr/lib64/perl5/5.8.6/x86_64-linux- +thread-multi/DynaLoader.pm line 230. at t/04misc.t line 8 Compilation failed in require at t/04misc.t line 8. BEGIN failed--compilation aborted at t/04misc.t line 8. # Looks like your test died before it could output anything. t/04misc............dubious Test returned status 255 (wstat 65280, 0xff00) t/05arrays..........skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/06bytea...........Can't load '/root/DBD-Pg-1.49/blib/arch/auto/DBD/P +g/Pg.so' for module DBD::Pg: libpq.so.3: cannot open shared object fi +le: No such file or directory at /usr/lib64/perl5/5.8.6/x86_64-linux- +thread-multi/DynaLoader.pm line 230. at t/06bytea.t line 7 Compilation failed in require at t/06bytea.t line 7. BEGIN failed--compilation aborted at t/06bytea.t line 7. # Looks like your test died before it could output anything. t/06bytea...........dubious Test returned status 255 (wstat 65280, 0xff00) t/07copy............skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/12placeholders....skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/20savepoints......skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file t/99_pod............ok t/99cleanup.........skipped all skipped: Cannot run test unless DBI_DSN is defined. See th +e README file Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/00basic.t 1 256 3 1 33.33% 2 t/01constants.t 255 65280 28 56 200.00% 1-28 t/03dbmethod.t 255 65280 ?? ?? % ?? t/04misc.t 255 65280 ?? ?? % ?? t/06bytea.t 255 65280 ?? ?? % ?? 9 tests skipped. Failed 5/16 test scripts, 68.75% okay. 29/34 subtests failed, 14.71% o +kay. make: *** [test_dynamic] Error 255


I installed postgres local from source as well. Any suggestions would be appreciated.

Thanks, Tito

Replies are listed 'Best First'.
Re: DBD::Pg Test Fails
by chargrill (Parson) on Jun 20, 2006 at 14:04 UTC

    Hi Tito,

    One of the errors is:

    all skipped: Cannot run test unless DBI_DSN is defined. See the README + file

    Have you read the README file?

    I haven't, but my experience with installing other DBI modules is that you need to do a little setup on the database side - create a test database, for example, so the test code can test connecting to the database and test doing some basic things (insert, update, delete, create, drop, etc).

    HTH



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
      Chargrill,

      I forgot to hit export for my export DBI_DSN=dbi:Pg:dbname=testdb

      Then, I had to set the library path for postgres:

      export LD_LIBRARY_PATH=/usr/local/pgsql/lib/

      Everything is fine now...thanks a bunch

      Tito