Online Shopping : Computers : Programming : Languages : PHP : Database Backed Sites : Postgres

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

34 of 52 people (65%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Why do I keep getting a "permission denied" error for Postgres queries?
How can I give a user permissions in Postgres?

May 18th, 2000 05:13
Nathan Wallace, Doug Semig


This answer assumes that you want the Postgres user "nobody" to have
permissions.

What you have to do now is GRANT permissions for the user "nobody" to do
things with your tables.  Log in to psql as the owner of the database
and type in:

GRANT SELECT, INSERT, DELETE, UPDATE ON tablename TO nobody;

Type that line in for each table your web application will need to run
select, insert, delete, and update queries on.  Note that if you don't
want to grant the "nobody" user the ability to delete or update, then
you'd leave those out of the GRANT statement.