Re: nobody user can't nextval('phone_id_seq') - Mailing list pgsql-sql

From Tod McQuillin
Subject Re: nobody user can't nextval('phone_id_seq')
Date
Msg-id Pine.GSO.4.31.0104140311540.3306-100000@sysadmin
Whole thread Raw
In response to nobody user can't nextval('phone_id_seq')  (Ian Pulsford <ianjp@optusnet.com.au>)
List pgsql-sql
On Sat, 14 Apr 2001, Ian Pulsford wrote:

> Newbie needs help.  I have a small web-based phonebook app using php and
> postgresql 7.02.  It seems the nobody (apache) user can delete, update,
> add anything except increment the 'id' sequence.  I don't think it's the
> code (cut and pasted from a tutorial) because the pgsql user can
> increment it.

You need to grant access to the sequence.

test=# \d foo                              Table "foo"Attribute |    Type     |                     Modifier
-----------+-------------+---------------------------------------------------key       | integer     | not null default
nextval('foo_key_seq'::text)name     | varchar(40) | not null
 

test=# GRANT ALL ON foo_key_seq TO nobody;
CHANGE

-- 
Tod McQuillin




pgsql-sql by date:

Previous
From: Ian Pulsford
Date:
Subject: nobody user can't nextval('phone_id_seq')
Next
From: Kovacs Zoltan
Date:
Subject: Re: enumerating rows