Received: from mail.xnet.com (quake.xnet.com [198.147.221.67]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3N3Pf378208 for ; Sun, 22 Apr 2001 23:25:42 -0400 (EDT) (envelope-from selkovjr@xnet.com) Received: from selkovjr.xnet.com ([204.248.57.203]) by mail.xnet.com (8.9.3+Sun/XNet-3.0R) with ESMTP id WAA22952; Sun, 22 Apr 2001 22:25:37 -0500 (CDT) Received: from selkovjr.xnet.com (localhost [127.0.0.1]) by selkovjr.xnet.com (8.9.3/8.9.3) with ESMTP id WAA18439; Sun, 22 Apr 2001 22:25:45 -0500 Message-Id: <200104230325.WAA18439@selkovjr.xnet.com> To: Randall Perry cc: pgsql-admin@postgresql.org, selkovjr@selkovjr.xnet.com From: selkovjr@mcs.anl.gov Reply-to: selkovjr@mcs.anl.gov Subject: Re: Connecting via perl gives "root" does not exist In-reply-to: References: Comments: In-reply-to Randall Perry message dated "Sun, 22 Apr 2001 19:54:25 -0400." Date: Sun, 22 Apr 2001 22:25:45 -0500 X-Archive-Number: 200104/105 X-Sequence-Number: 1242 > use Pg; > $conn = Pg::connectdb("dbname=tasbill"); > $res = $conn->exec("SELECT * from cust"); > while (@row = $res->fetchrow) { > print join(" ", @row); > } > > > Works fine if I log in as 'postgres' before executing script, but fails if > logged in as any other user. I'm using the default pg_hba.conf file, which I > thought would allow local users to connect to any database: > > local all trust > host all 127.0.0.1 255.255.255.255 trust > > What am I missing?? Either one or both of following: 1. Use proper user name in connectdb() call 2. Run 'createuser ' on the server side, where belongs to the user running the client script. pg_hba.conf decides what hosts can connect and *how* to authenticate users names. It does not control user access. That's what createuser and GRANT queries are for. --Gene