I am on Mac OS X Lion with Pg 9.0.x, Perl 5.14.1, and the latest iterations of 
DBI and DBD::Pg. My code is pretty straightforward

    my $dbh = DBI->connect("dbi:Pg:dbname=macromap;host=localhost;port=5432", 
'postgres', 'postgres');
    my $sth = $dbh->prepare( .. );
    $sth->execute;
    while (my (retrieved columns) = $sth->fetchrow_array) {
        do something with retrieved columns  
    }
    
The code bombs with the message:

DBD::Pg::st execute failed: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request. at ...
        
        
I turned on `DBI->trace(3, '/path/to/dbi.log')` and got the following, which, 
to me, tells no more than the above

    DBI 1.616-nothread default trace level set to 0x0/3 (pid 20132 pi 
7fe30c000000) at geomaps.pm line 30 via app.pl line 3
    -> DBI->connect(dbi:Pg:dbname=macromap;host=localhost;port=5432, postgres, 
****)
    -> DBI->install_driver(Pg) for darwin perl=5.014001 pid=20132 ruid=501 
euid=501
       install_driver: DBD::Pg version 2.18.1 loaded from 
/opt/local/lib/perl5/site_perl/5.14.1/darwin-multi-2level/DBD/Pg.pm
    <- install_driver= DBI::dr=HASH(0x7fe30c58baf0)
    !! warn: 0 CLEARED by call to connect method
    -> connect for DBD::Pg::dr (DBI::dr=HASH(0x7fe30c58baf0)~0x7fe30c58ba30 
'dbname=macromap;host=localhost;port=5432' 'postgres' **** HASH(0x7fe30c4639b0))
    <- FETCH= ( 90004 ) [1 items] at Pg.pm line 227 via  at geomaps.pm line 33
    .. FETCH DBI::db=HASH(0x7fe30c5c5620) 'private_dbdpg' = undef
    <- FETCH= ( undef ) [1 items] at Pg.pm line 228 via  at geomaps.pm line 33
    STORE DBI::db=HASH(0x7fe30c5c5620) 'private_dbdpg' => HASH(0x7fe30c5c5950)
    <- STORE= ( 1 ) [1 items] at Pg.pm line 228 via  at geomaps.pm line 33
    <- connect= ( DBI::db=HASH(0x7fe30c5c56f8) ) [1 items] at DBI.pm line 665 
via  at app.pl line 3
    -> STORE for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c5620)~INNER 'PrintError' 1)
    STORE DBI::db=HASH(0x7fe30c5c5620) 'PrintError' => 1
    <- STORE= ( 1 ) [1 items] at DBI.pm line 717 via  at app.pl line 3
    -> STORE for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c5620)~INNER 'AutoCommit' 1)
    <- STORE= ( 1 ) [1 items] at DBI.pm line 717 via  at app.pl line 3
    -> STORE for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c5620)~INNER 'Username' 
'postgres')
    STORE DBI::db=HASH(0x7fe30c5c5620) 'Username' => 'postgres'
    <- STORE= ( 1 ) [1 items] at DBI.pm line 720 via  at geomaps.pm line 33
    -> connected in DBD::_::db for DBD::Pg::db 
(DBI::db=HASH(0x7fe30c5c56f8)~0x7fe30c5c5620 
'dbi:Pg:dbname=macromap;host=localhost;port=5432' 'postgres' 'postgres')
    <- connected= ( undef ) [1 items] at DBI.pm line 727 via  at app.pl line 3
    <- connect= DBI::db=HASH(0x7fe30c5c56f8)
    -> STORE for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c5620)~INNER 
'dbi_connect_closure' CODE(0x7fe30c5c4e88))
    STORE DBI::db=HASH(0x7fe30c5c5620) 'dbi_connect_closure' => 
CODE(0x7fe30c5c4e88)
    <- STORE= ( 1 ) [1 items] at DBI.pm line 736 via  at geomaps.pm line 33
    -- DBI::END ($@: , $!: )
    -> disconnect_all for DBD::Pg::dr 
(DBI::dr=HASH(0x7fe30c58baf0)~0x7fe30c58ba30)
    <- disconnect_all= ( '' ) [1 items] at DBI.pm line 744 via  at Server.pm 
line 294
!   <> DESTROY(DBI::db=HASH(0x7fe30c5c56f8)) ignored for outer handle (inner 
DBI::db=HASH(0x7fe30c5c5620) has ref cnt 1)
!   -> DESTROY for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c5620)~INNER)
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   <> DESTROY(DBI::dr=HASH(0x7fe30c58baf0)) ignored for outer handle (inner 
DBI::dr=HASH(0x7fe30c58ba30) has ref cnt 1)
!   -> DESTROY in DBD::_::common for DBD::Pg::dr 
(DBI::dr=HASH(0x7fe30c58ba30)~INNER)
!   <- DESTROY= ( undef ) [1 items] during global destruction
    -> prepare for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c56f8)~0x7fe30c5c5620 
'SELECT interval_name, color_hex FROM intervals_old')
    <- prepare= ( DBI::st=HASH(0x7fe30c6a97c8) ) [1 items] at geomaps.pm line 
1224 via  at Route.pm line 240
    -> execute for DBD::Pg::st (DBI::st=HASH(0x7fe30c6a97c8)~0x7fe30c6a9408)
    !! ERROR: 7 'server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.' (err#0)
    <- execute= ( undef ) [1 items] at geomaps.pm line 1225 via  at Route.pm 
line 240
    -> errstr in DBD::_::common for DBD::Pg::st 
(DBI::st=HASH(0x7fe30c6a97c8)~0x7fe30c6a9408)
       ERROR: 7 'server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.' (err#0)
    <- errstr= ( 'server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.' ) [1 items] at geomaps.pm line 
1225 via  at Route.pm line 240
    !! ERROR: 7 CLEARED by call to fetchrow_array method
    -> fetchrow_array for DBD::Pg::st 
(DBI::st=HASH(0x7fe30c6a97c8)~0x7fe30c6a9408)
    !! ERROR: 6 'no statement executing' (err#0)
    <- fetchrow_array= ( ) [0 items] row-1 at geomaps.pm line 1226 via  at 
Route.pm line 240
    !! ERROR: 6 CLEARED by call to prepare method
    -> prepare for DBD::Pg::db (DBI::db=HASH(0x7fe30c5c56f8)~0x7fe30c5c5620 
'SELECT DISTINCT species_id, latin_name FROM trees.range r JOIN trees.species s 
ON r.species_id = s.id')
    <- prepare= ( DBI::st=HASH(0x7fe30c6a91e0) ) [1 items] at geomaps.pm line 
1252 via  at Route.pm line 240
    <> DESTROY(DBI::st=HASH(0x7fe30c6a97c8)) ignored for outer handle (inner 
DBI::st=HASH(0x7fe30c6a9408) has ref cnt 1)
    -> DESTROY for DBD::Pg::st (DBI::st=HASH(0x7fe30c6a9408)~INNER)
    <- DESTROY= ( undef ) [1 items] at geomaps.pm line 1253 via  at geomaps.pm 
line 1253
    -> execute for DBD::Pg::st (DBI::st=HASH(0x7fe30c6a91e0)~0x7fe30c6a9810)
    !! ERROR: 7 'no connection to the server' (err#0)
    <- execute= ( undef ) [1 items] at geomaps.pm line 1253 via  at Route.pm 
line 240
    !! ERROR: 7 CLEARED by call to fetchrow_array method
    -> fetchrow_array for DBD::Pg::st 
(DBI::st=HASH(0x7fe30c6a91e0)~0x7fe30c6a9810)
    !! ERROR: 6 'no statement executing' (err#0)
    <- fetchrow_array= ( ) [0 items] row-1 at geomaps.pm line 1254 via  at 
Route.pm line 240
    <> DESTROY(DBI::st=HASH(0x7fe30c6a91e0)) ignored for outer handle (inner 
DBI::st=HASH(0x7fe30c6a9810) has ref cnt 1)
    -> DESTROY for DBD::Pg::st (DBI::st=HASH(0x7fe30c6a9810)~INNER)
       ERROR: 6 'no statement executing' (err#0)
    <- DESTROY= ( undef ) [1 items] at Route.pm line 240 via  at Route.pm line 
240

Suggestions?

Reply via email to