Re: nobody user can't nextval('phone_id_seq')

From: Tod McQuillin <devin(at)spamcop(dot)net>
To: Ian Pulsford <ianjp(at)optusnet(dot)com(dot)au>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: nobody user can't nextval('phone_id_seq')
Date: 2001-04-14 08:17:27
Message-ID: Pine.GSO.4.31.0104140311540.3306-100000@sysadmin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2001-04-14 09:09:16 Re: Dropping users with no name
Previous Message Kovacs Zoltan 2001-04-14 08:14:45 Re: enumerating rows