Re: problem inserting with sequence

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: problem inserting with sequence
Дата
Msg-id 20050728143139.GA76359@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: problem inserting with sequence  (germ germ <super_code_monkey@yahoo.com>)
Ответы Re: problem inserting with sequence  (germ germ <super_code_monkey@yahoo.com>)
Список pgsql-general
On Thu, Jul 28, 2005 at 07:04:54AM -0700, germ germ wrote:
> This is the error: 2005-07-28 08:51:08 ERROR:
> permission denied for sequence requests_req_num_seq
>
> I've tried these grants, but no luck:
> GRANT ALL ON FUNCTION nextval(integer) TO wwwrun,
> postgres;
> GRANT ALL ON FUNCTION nextval('requests_req_num_seq')
> TO wwwrun, postgres;
> GRANT ALL ON FUNCTION nextval() TO wwwrun, postgres;

It's not the nextval() function itself that needs permission, it's
the sequence.  Try this:

GRANT UPDATE, SELECT ON requests_req_num_seq TO wwwrun;

Granting update on a sequence allows the use of nextval() and
setval() on that sequence; granting select allows currval().

http://www.postgresql.org/docs/7.4/static/sql-grant.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-general по дате отправления:

Предыдущее
От: Douglas McNaught
Дата:
Сообщение: Re: problem inserting with sequence
Следующее
От: Tom Lane
Дата:
Сообщение: Re: problem inserting with sequence