Received: from home.xach.com (ptldme-cmt2-c4-66-30-11-213.maine.rr.com [66.30.11.213]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4NKY9A55067 for ; Wed, 23 May 2001 16:34:09 -0400 (EDT) (envelope-from xach@xach.com) Received: by home.xach.com (Postfix, from userid 501) id DABBD76CF; Wed, 23 May 2001 16:34:32 -0400 (EDT) Date: Wed, 23 May 2001 16:34:32 -0400 From: Zachary Beane To: pgsql-interfaces@postgresql.org Subject: DBD::Pg or DBI breakage? Message-ID: <20010523163432.I18366@xach.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-Archive-Number: 200105/99 X-Sequence-Number: 1629 I've been having trouble getting the proper value of $handle->errstr or $DBI::errstr. For some reason, it's always giving the scalar 7 back rather than an informative error message. Here's an script and output: --- foo.pl --- #!/usr/bin/perl use DBI; my $dbh = DBI->connect("dbi:Pg:dbname=template1", "xach", undef); my $sql = "bogus sql goes here"; my $sth = $dbh->prepare($sql); $sth->execute() or die $sth->errstr; my ($result) = $sth->fetchrow_array(); $sth->finish; print $result, "\n"; $dbh->disconnect(); --- end --- When run, it prints out this: $ perl foo.pl DBD::Pg::st execute failed: at foo.pl line 8. 7 at foo.pl line 8. Database handle destroyed without explicit disconnect. Now, I'm not surprised at the "database handle destroyed..." part, but I can't figure out why i'm getting "7 at foo.pl" and a blank message in the execute failed string. Any ideas? Zach -- xach@xach.com Zachary Beane http://www.xach.com/