Problems with Postgres and PHP from command line - Mailing list pgsql-general

From Kristopher Spencer-Yates
Subject Problems with Postgres and PHP from command line
Date
Msg-id 40DB3DD0.5090207@2binteractive.com
Whole thread Raw
Responses Re: Problems with Postgres and PHP from command line  (mike g <mike@thegodshalls.com>)
List pgsql-general
Hi

I have a PHP script running as a non-root user.  The non-root user will
exec PHP script via cron once per day.

Warning: pg_exec(): Query failed: ERROR:  checkout: Permission denied.
. in /usr/home/nonrootuser/script.php on line 23

Line 23 is, of course, the $result = pg_exec($db_connect, $call);

My DB connect is to a postgres server (same physical box as where script
is running).

$db_connect=pg_connect("user=nonrootuser dbname=thedatabase");

note: PHP website can connect with no problems to this local postgres
db; apache runs as nobody, connecting via a PHP db_connect as
"user=someotheruser dbname=thedatabase".

"thedatabase" looks like:
checkout | table | someotheruser

So I did a grant all priviliges for "nonrootuser" and "nobody" on all
tables in "thedatabase".  I do a \z on a table and see my grant.. but it
isnt working.  Not sure what else to provide at this time to help anyone
willing to help me.. Just ask and I'll be able to provide any info on
request.

So.. my question:  How do we get unix command line user "nonrootuser" to
run a script as "nonrootuser" and access "thedatabase"?  I searched the
docs already and so now I am here begging for help :)

Thanks,

Kris

--
Kristopher Spencer-Yates
Sr. Programmer/Systems Administration
kris@2binteractive.com



pgsql-general by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: 7.4.3 RPMS for RHEL3
Next
From: rchinni73@yahoo.com (beginner)
Date:
Subject: psql