Re: Accessing the database

From: Daryl Herzmann <akrherz(at)iastate(dot)edu>
To: Pragati Sagar <pragatis(at)sapientinfotech(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Accessing the database
Date: 2000-06-02 15:34:42
Message-ID: Pine.LNX.4.21.0006021028110.13143-100000@cydonia.iitap.iastate.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Pragati,
I am assuming that your webserver is running as user "nobody". If
that is the case, then you need to make sure that the user "nobody" can
access the table.
If your scripts only do selects on the table, then this command
would do the trick

GRANT SELECT on table1 to nobody;

Check the docs on the GRANT command, you may need to give user
nobody more provledges than SELECT, if your scripts are doing other things
than SELECT...

http://www.postgresql.org/docs/user/sql-grant.htm

Also, make sure that the user nobody exists. You may need to add
this user too from a postgres superuser account...

http://www.postgresql.org/docs/user/sql-createuser.htm

Hope this helps,
Daryl

On Fri, 2 Jun 2000, Pragati Sagar wrote:

~|Hi!
~|I connecting the postgreSQL database through the following code:
~|
~|<?
~|$conn=pg_connect("<IP address>","<port>","","","<database>");
~|$index=pg_exec($conn,"select * from table1");
~|?>
~|
~|On execution of this code from the browser, following error appears :
~|
~|Warning: PostgresSQL query failed: ERROR: table1: Permission denied. in
~|/home/httpd/html/script.php3 on line 8
~|
~|Where am I going wrong? Does the code have a problem or there is something
~|wrong with the permissions.
~|Please help me out.
~|
~|Thanks
~|Pragati
~|

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Karel Zak 2000-06-02 16:09:37 Re: Re: Future plans for raw devices ?
Previous Message Anthony E. Greene 2000-06-02 15:31:24 Re: Importing table from mysql