Re: Connecting via perl gives "root" does not exist

From: Randall Perry <rgp(at)systame(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Connecting via perl gives "root" does not exist
Date: 2001-04-23 04:38:09
Message-ID: B70929F0.A19E%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

on 4/22/01 11:25 PM, selkovjr(at)mcs(dot)anl(dot)gov at selkovjr(at)mcs(dot)anl(dot)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 <username>' on the server side, where <username>
> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2001-04-23 05:07:53 Re: Large database help
Previous Message selkovjr 2001-04-23 03:25:45 Re: Connecting via perl gives "root" does not exist