Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-admin by date

Next:From: praveenDate: 2008-10-21 09:25:58
Subject: Re: Move tables to tablespace
Previous:From: FMDate: 2008-10-20 19:58:45
Subject: Privileges on sequences

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group