From: selkovjr@mcs.anl.gov
To: Randall Perry <rgp@systame.com>
Cc: pgsql-admin@postgresql.org
Cc: selkovjr@selkovjr.xnet.com
Subject: Re: Connecting via perl gives "root" does not exist
Date: Sun, 22 Apr 2001 22:25:45 -0500
Message-ID: <200104230325.WAA18439@selkovjr.xnet.com> (raw)
In-Reply-To: <B708E770.A17F%rgp@systame.com>
References: <B708E770.A17F%rgp@systame.com>
> 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
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: selkovjr@mcs.anl.gov, rgp@systame.com, selkovjr@selkovjr.xnet.com
Subject: Re: Connecting via perl gives "root" does not exist
In-Reply-To: <200104230325.WAA18439@selkovjr.xnet.com>
References: <B708E770.A17F%rgp@systame.com> <200104230325.WAA18439@selkovjr.xnet.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