pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPrivileges on sequences
2+ messages / 2 participants
[nested] [flat]
* Privileges on sequences
@ 2008-10-20 19:58 FM <dist-list@LEXUM.UMontreal.CA>
0 siblings, 1 reply; 2+ messages in thread
From: FM @ 2008-10-20 19:58 UTC (permalink / raw)
To: pgsql-admin
Hello,
We are using PGSQL 8.3.4
I have problem to grant privileges to a sequence.
If I grant all to the user I can do something like :
SELECT nextval('reflex_cited_reports_id');
SELECT nextval('reflex_cited_reports_id');
nextval
----------
40442939
(1 row)
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
some info :
canlii_integration_tests=# SELECT nextval('reflex_cited_reports_id');
nextval
----------
40442939
(1 row)
canlii_integration_tests=# SELECT * from pg_roles where
rolname='soft_reflex_externe';
rolname | rolsuper | rolinherit | rolcreaterole |
rolcreatedb | rolcatupdate | rolcanlogin | rolconnlimit | rolpassword |
rolvaliduntil | rolconfig | oid
---------------------+----------+------------+---------------+-------------+--------------+-------------+--------------+-------------+---------------+-----------+-----------
soft_reflex_externe | f | f | f |
f | f | t | -1 | ******** |
infinity | | 820769731
(1 row)
canlii_integration_tests=# SELECT * from pg_group where
groname='reflex_lecteurs';
groname | grosysid |
grolist
-----------------+----------+-------------------------------------------------------------------
reflex_lecteurs | 16431 |
{16400,16409,16417,16418,16424,16434,16479,16499,16500,820769731}
(1 row)
Is it a bug ? Or am i doing something wrong
Regards,
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Privileges on sequences
@ 2008-10-20 22:50 Tom Lane <tgl@sss.pgh.pa.us>
parent: FM <dist-list@LEXUM.UMontreal.CA>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2008-10-20 22:50 UTC (permalink / raw)
To: FM <dist-list@LEXUM.UMontreal.CA>; +Cc: pgsql-admin
FM <dist-list@LEXUM.UMontreal.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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-10-20 22:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-10-20 19:58 Privileges on sequences FM <dist-list@LEXUM.UMontreal.CA>
2008-10-20 22:50 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox