From: Randall Perry <rgp@systame.com>
To: pgsql-admin@postgresql.org
Subject: Re: Connecting via perl gives "root" does not exist
Date: Mon, 23 Apr 2001 00:38:09 -0400
Message-ID: <B70929F0.A19E%rgp@systame.com> (raw)
In-Reply-To: <200104230325.WAA18439@selkovjr.xnet.com>
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 <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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: rgp@systame.com
Subject: Re: Connecting via perl gives "root" does not exist
In-Reply-To: <B70929F0.A19E%rgp@systame.com>
References: <200104230325.WAA18439@selkovjr.xnet.com> <B70929F0.A19E%rgp@systame.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox