You only need grants on select and update for sequence tables.

Mikio

Mike Mascari wrote:
> 
> sheila bel wrote:
> >
> > Hi everyone,
> >
> > I'm trying to use currval from php3. This is what I'm doing :
> >
> > $result=pg_Exec($conn,$addstmt)
> > (where $addstmt is a insert statement)
> >
> > $result2=pg_Exec($conn,"SELECT currval('table_id_seq')");
> >
> > This is the ERROR message that I'm getting:
> >
> > Warning: PostgresSQL query failed: ERROR: table_id_seq.currval:
> > Permission denied. in /home/httpd/html/ces/php3/add.php3 on line 51
> >
> > In psql I have granted permission as follows :
> >
> > grant all on table to nobody;
> >
> > Does anyone know why I'm getting this error and how it can be fixed ?
> > Is there any other way of using currval or nextval in php3 ?
> >
> > Thanks in advance for your help,
> > -Sheila
> 
> Sequences have permissions as well. So all you should have to do
> is:
> 
> grant all on table_id_seq to nobody;
> 
> Hope that helps,
> 
> Mike Mascari

-- 
**********************************************************************
*                                                                    *
*       Mikio-Yves Matsuo         Newbridge Networks Corporation     *  
*       Software Designer         600 March Road Box 13600           *
*       [EMAIL PROTECTED]    Kanata, Ontario K2K 2E6            *
*                                 http://www.newbridge.com           *
*                                                                    *
**********************************************************************

Reply via email to