Received: from mail6.lig.bellsouth.net (mail6.lig.bellsouth.net [207.203.120.45]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3N4e4398530 for ; Mon, 23 Apr 2001 00:40:04 -0400 (EDT) (envelope-from rgp@systame.com) Received: from [216.77.205.80] (host-216-77-205-80.psl.bellsouth.net [216.77.205.80]) by mail6.lig.bellsouth.net (3.3.5alt/0.75.2) with ESMTP id AAA21180 for ; Mon, 23 Apr 2001 00:40:02 -0400 (EDT) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Mon, 23 Apr 2001 00:38:09 -0400 Subject: Re: Connecting via perl gives "root" does not exist From: Randall Perry To: Message-ID: In-Reply-To: <200104230325.WAA18439@selkovjr.xnet.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200104/106 X-Sequence-Number: 1243 on 4/22/01 11:25 PM, selkovjr@mcs.anl.gov at selkovjr@mcs.anl.gov wrote: >> 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 > Thanks. Did try createuser and grant commands, but forgot to end with ';'. Re-did it and it works. -- Randy Perry sysTame Mac Consulting/Sales