Re: [GENERAL] User privileges on sequences

2001-10-17 Thread Peter Eisentraut

Mihai Gheorghiu writes:

> Therefore, I have to give users permissions to sequences, just to the
> extent that they could add records. What is the minimum set of
> privileges for this?

You need UPDATE privileges to be able to execute nextval() and currval().
I assume this would include setval() as well, though I don't see it in the
docs offhand.

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[GENERAL] User privileges on sequences

2001-10-16 Thread Mihai Gheorghiu

I have a db in which users can view and update data only via views.
It is my understanding that the privileges of the view/rule creator do not
extend to sequences. Therefore, I have to give users permissions to
sequences, just to the extent that they could add records. What is the
minimum set of privileges for this? Are SELECT privileges on sequences
enough? What happens actually when a user issues a statement: SELECT
nextval("sequence")? What about setval()? Do these involve only a SELECT to
the sequence, or is it an UPDATE, or is it a DELETE and INSERT, or just an
INSERT?


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html