Unix Technical Forum

Grant on multiple objects

This is a discussion on Grant on multiple objects within the pgsql Novice forums, part of the PostgreSQL category; --> Is it possible to GRANT permissions on multiple objects at once? I would like to assign limited permissions on ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:18 PM
Jason Dixon
 
Posts: n/a
Default Grant on multiple objects

Is it possible to GRANT permissions on multiple objects at once? I
would like to assign limited permissions on multiple objects (tables,
indices, sequences in the same database) without granting full
ownership. For example, something like this:

GRANT SELECT, INSERT, UPDATE on (SELECT relname FROM pg_class WHERE
relkind in ('r', 'i', 'S') AND relnamespace=2200) to jason;

Is this possible? I understand from reading the documentation that
this is not in the SQL standard, but I'm hopeful there is some type of
work-around.

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:18 PM
Bruno Wolff III
 
Posts: n/a
Default Re: Grant on multiple objects

On Sat, Jan 01, 2005 at 11:04:16 -0500,
Jason Dixon <jason@dixongroup.net> wrote:
> Is it possible to GRANT permissions on multiple objects at once? I
> would like to assign limited permissions on multiple objects (tables,
> indices, sequences in the same database) without granting full
> ownership. For example, something like this:


Yes, but not the way you want. You can list multiple objects of the same
type when issuing a GRANT command. However you can't use a query in the
GRANT statement to generate the list. If you are doing this programatically
you could do a select for each type and use the results to build GRANT
statements.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:18 PM
Jason Dixon
 
Posts: n/a
Default Re: Grant on multiple objects

On Jan 1, 2005, at 2:18 PM, Bruno Wolff III wrote:

> On Sat, Jan 01, 2005 at 11:04:16 -0500,
> Jason Dixon <jason@dixongroup.net> wrote:
>> Is it possible to GRANT permissions on multiple objects at once? I
>> would like to assign limited permissions on multiple objects (tables,
>> indices, sequences in the same database) without granting full
>> ownership. For example, something like this:

>
> Yes, but not the way you want. You can list multiple objects of the
> same
> type when issuing a GRANT command. However you can't use a query in the
> GRANT statement to generate the list. If you are doing this
> programatically
> you could do a select for each type and use the results to build GRANT
> statements.


Thanks for clarifying this. I guess I'll write a DBD::Pg script to
automate much of the work.

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com