Re: Privileges on sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: FM <dist-list(at)LEXUM(dot)UMontreal(dot)CA>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Privileges on sequences
Date: 2008-10-20 22:50:24
Message-ID: 5694.1224543024@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

FM <dist-list(at)LEXUM(dot)UMontreal(dot)CA> writes:
> BUT if I grant the same priv to the group (that include the user) :
> SELECT nextval('reflex_cited_reports_id');
> ERROR: permission denied for sequence reflex_cited_reports_id

Works for me ...

regression=# create sequence s1;
CREATE SEQUENCE
regression=# create user u1;
CREATE ROLE
regression=# \c - u1
You are now connected to database "regression" as user "u1".
regression=> select nextval('s1');
ERROR: permission denied for sequence s1
regression=> \c - postgres
You are now connected to database "regression" as user "postgres".
regression=# create group g1;
CREATE ROLE
regression=# grant g1 to u1;
GRANT ROLE
regression=# grant all on sequence s1 to g1;
GRANT
regression=# \c - u1
You are now connected to database "regression" as user "u1".
regression=> select nextval('s1');
nextval
---------
1
(1 row)

regression=>

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message praveen 2008-10-21 09:25:58 Re: Move tables to tablespace
Previous Message FM 2008-10-20 19:58:45 Privileges on sequences