X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3B7ED4764D8 for ; Wed, 7 May 2003 14:01:25 -0400 (EDT) Received: from www.trade-india.com (ns1.trade-india.com [66.234.10.14]) by postgresql.org (Postfix) with SMTP id 30A34476368 for ; Wed, 7 May 2003 14:01:24 -0400 (EDT) Received: (qmail 26783 invoked by uid 99); 7 May 2003 18:01:24 -0000 Received: from 219.65.253.25 (SquirrelMail authenticated user mallah) by mail.trade-india.com with HTTP; Wed, 7 May 2003 23:31:24 +0530 (IST) Message-ID: <1410.219.65.253.25.1052330484.squirrel@mail.trade-india.com> Date: Wed, 7 May 2003 23:31:24 +0530 (IST) Subject: Re: [GENERAL] PostgreSQL Qs From: To: In-Reply-To: References: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-24.9 required=5.0 tests=BAYES_01,IN_REP_TO,MISSING_MIMEOLE,MISSING_OUTLOOK_NAME, NO_REAL_NAME,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/142 X-Sequence-Number: 13307 Hi , shudn't "host" lines in pg_hba.conf be in format host database user ip mask method in lines below u missed the user part: > host all 127.0.0.1 255.0.0.0 md5 > host dbname 0.0.0.0 255.255.255.255 md5 i think pg_hba.conf is pretty cool otherwise. regds mallah. > Hey folks, > > I've been trying to figure out the user authentication stuff in > PostgreSQL, and am finding it more confusing than mysql. > > My system runs Debian, I installed postgresql from apt. It seemed to pro= ceed correctly (no > errors were tossed my way). As user postgres, I created the db and table= structure. Again, > seemed to proceed correctly. > > I changed /etc/postgresql/pg_hba.conf to: > > local all md5 > host all 127.0.0.1 255.0.0.0 md5 > host dbname 0.0.0.0 255.255.255.255 md5 > > Then, I went to add the DBD-Pg module for Perl (compiled from scratch). I= set the env vars: > > export DBI_DSN=3Ddbi:Pg:dbname=3Dtemplate1 > export DBI_USER=3Dpostgres > export DBI_PASS=3Dxxxxxx > > Then I ran 'make test'. I got a lot of: > > .. > t/99cleanup.........DBI connect('dbname=3Dtemplate1','postgres',...) fail= ed: FATAL 1: Password > authentication failed for user "postgres" at > t/99cleanup.t line 11 > .. > > Changing AUTH_TYPE from 'md5' to 'password' gives the same error. The on= ly way I can get > anything to run (the test scripts or the script below) is to change the A= UTH_TYPE to 'trust' > (Note: I can run the script below as user postgres if I leave the AUTH_TY= PE and AUTH_ARGUMENT > as the default values [ident and sameuser], but, since I don't run an ide= nt server, this > doesn't make sense to me.) Obviously, I don't want to leave the AUTH_TYP= E as trust, but I'm > not sure what I need to do to get a username/password combo to work (part= icularly within a perl > script using DBI [When I tested this using mysql, I had it working and fo= und it much simpler]. > > Could someone explain or give me a link to a doc that explains what is go= ing on as far as user > authentication is concerned? Actually, a basic howto guide for PGSQL wou= ld be most helpful for > many things. > > Cheers! > Jon > > > Test Script (from O'Reilly's Programming the Perl DBI): > > #!/usr/bin/perl -w > use DBI; > > my @drivers =3D DBI->available_drivers(); > > die "No drivers.\n" unless @drivers; > > foreach my $driver (@drivers) { > print "Driver: $driver\n"; > my @datasources =3D DBI->data_sources($driver); > foreach my $datasource (@datasources) { > print "\tData source is $datasource\n"; > } > print "\n"; > } > > exit; > > > ---------------------------(end of broadcast)--------------------------- = TIP 1: subscribe and > unsubscribe commands go to majordomo@postgresql.org ----------------------------------------- Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/