X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6FE1C11F677C for ; Thu, 6 Apr 2006 13:34:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08349-01-2 for ; Thu, 6 Apr 2006 13:34:29 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B031211F6775 for ; Thu, 6 Apr 2006 13:34:29 -0300 (ADT) Received: from mx-7.zoominternet.net (mx-7.zoominternet.net [24.154.1.26]) by svr4.postgresql.org (Postfix) with ESMTP id 5A20E5AF988 for ; Thu, 6 Apr 2006 16:34:29 +0000 (GMT) Received: from mua-1.zoominternet.net (mua-1.zoominternet.net [24.154.1.44]) by mx-7.zoominternet.net (8.12.11/8.12.11) with ESMTP id k36GYLdF014533 for ; Thu, 6 Apr 2006 12:34:21 -0400 Received: from [192.168.0.188] (dynamic-acs-24-144-211-60.zoominternet.net [24.144.211.60]) by mua-1.zoominternet.net (Postfix) with ESMTP id 401E57F418 for ; Thu, 6 Apr 2006 12:34:21 -0400 (EDT) Subject: DBI connect returning an empty hash From: Scott Cain To: pgsql-interfaces@postgresql.org Content-Type: text/plain Date: Thu, 06 Apr 2006 12:34:22 -0400 Message-Id: <1144341262.28535.162.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-CanItPRO-Stream: outgoing X-Scanned-By: CanIt (www . roaringpenguin . com) on 24.154.1.26 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/13 X-Sequence-Number: 6104 Hi all, I am developing a perl module that, when it is created, establishes a DBI connection to my postgresql database. The problem I am having is that when I issue a DBI->connect command, the database handle it returns is empty (Data::Dumper shows it as an empty hash). Here is my code: sub new { my $class = shift; my %arg = @_; my $self = bless {}, ref($class) || $class; my $dbname = $arg{dbname}; my $dbport = $arg{dbport}; my $dbhost = $arg{dbhost}; my $dbuser = $arg{dbuser}; my $dbpass = $arg{dbpass}; my $notrans= $arg{notransact}; warn $dbname,$dbport,$dbhost; warn $dbuser,$notrans; my $dbh = DBI->connect( "dbi:Pg:dbname=$dbname;port=$dbport;host=$dbhost", $dbuser, $dbpass, {AutoCommit => $notrans, TraceLevel => 4} ) or die; warn Dumper($dbh); ...etc... The trace output doesn't show anything strange, and DBI.pm at least seems to think things went OK, because it doesn't `die` on that line. I wrote a simple test script that does exactly the same thing, and it works. Does anyone have any suggestions for what might be going on here? Thanks, Scott -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.edu GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory