Problems with Postgres and PHP from command line

From: Kristopher Spencer-Yates <kris(at)2binteractive(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Problems with Postgres and PHP from command line
Date: 2004-06-24 20:47:12
Message-ID: 40DB3DD0.5090207@2binteractive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2binteractive(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-06-24 21:46:49 Re: Renaming a schema
Previous Message Dennis Gearon 2004-06-24 20:13:32 Re: hackers dudes