Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3G1rVu65643 for ; Sun, 15 Apr 2001 21:53:31 -0400 (EDT) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from infocom.com (infocom.com [199.120.185.1]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3G1ibu64192 for ; Sun, 15 Apr 2001 21:44:38 -0400 (EDT) (envelope-from mark@summersault.com) Received: from summersault.com (dun1-40-2-Richmond.in.skyenet.net [216.117.89.40]) by infocom.com (8.9.3/8.8.5) with ESMTP id UAA71033; Sun, 15 Apr 2001 20:44:29 -0500 (EST) Message-ID: <3ADA4EE7.2324BE3B@summersault.com> Date: Sun, 15 Apr 2001 20:46:15 -0500 From: Mark Stosberg X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: "Brett W. McCoy" CC: pgsql-interfaces@postgresql.org, dbi-users@perl.org Subject: Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200104/53 X-Sequence-Number: 1436 Brett, I believe this due to a bug in DBD::Pg .96. See the recent thread on the dbi-users list entitled: "bug in DBD::Pg .96-- connect user mishandled?" A patch is in the works, and a workaround seems to be to use $ENV{DBI_USER} and $ENV{DBI_PASS} to set the username and password, which seem to be respected appropriately. -mark "Brett W. McCoy" wrote: > > I've just upgraded to DBD::Pg 0.96 and DBI 1.15, and now every script I > have that uses DBI gives me this error: > > 1.15 at ./dbi-test line 6 > Use of uninitialized value in subroutine entry at > /usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94. > Use of uninitialized value in subroutine entry at > /usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94. > DBI->connect(dbname=cp) failed: fe_sendauth: no password supplied at > ./dbi-test line 8 > > The test.pl script used in the DBD 'make test' also failed with this > error. I have not changed anything in my PostgreSQL (7.1beta3) setup or > in my scripts. > > I have password authentication set for local users, and do have $PGHOST > set accordingly. Logging into psql works fine, but all of my Perl DBI > scripts are failing. > > Here is a test program that is causing this error (the real user name and > password are changed): > > #!/usr/local/bin/perl -w > > use strict; > use DBI; > > warn $DBI::VERSION; > > my $dbh = DBI->connect('DBI:Pg:dbname=cp', 'user', 'passwd') or DBI-errstr; > > $dbh->disconnect(); > > This gives the error output above also. > > If I change pg_hba.conf to 'trust' on localhost, (and unset $PGHOST) and I > run the same script, it tells me that 'bmccoy' (who I am logged in as) > does not exist as a user (which is true). It looks like the user and > password fields are being completely ignored by DBD::Pg. > > What happened? > > -- Brett > http://www.chapelperilous.net/btfwk/ > ------------------------------------------------------------------------ > Adapt. Enjoy. Survive. -- http://mark.stosberg.com/