[ADMIN] How do I grant access to entire database at once(schemas,tables,sequences,...)?

2004-05-17 Thread Ulrich Meis
Hi !
I administrate a development server for a little team, and people want
to be able to grant access to an entire database to other
developers/freelancers.
Up till now, I see two possibilities :
1. Write a script that queries the postgres internal tables for all
tables,schemas,sequences,views,functions,... and then executes grant
statements for each one of them. This would have to be repeated each 
time a new object is created.

2.(Not sure if this works) Insert a trigger on postgres's internal
tables in template1 that grants permission to a group, say 
dbname_group, to the created object. Developers that need access to 
the database can then be added to that group.

Both solutions require a serious amount of work compared to the simple task.
Is there a simpler or better way to do this?
Thanks for any ideas and comments!
greetings,
Uli

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])


[ADMIN] How do I grant access to entire database at once(schemas,tables,sequences,...)?

2004-05-17 Thread Ulrich Meis
Hi !
I administrate a development server for a little team, and people want 
to be able to grant access to an entire database to other 
developers/freelancers.
Up till now, I see two possibilities :

1. Write a script that queries the postgres internal tables for all 
tables,schemas,sequences,views,functions,... and then executes grant 
statements for each one of them. This would have to repeated each time a 
new object is created.

2.(Not sure if this works) Insert a trigger on postgres's internal 
tables in template1 that grants permission to a group say dbname_group 
to the created object. Developers that need access to the database can 
then be added to that group.

Both solutions require a serious amount of work compared to the simple task.
Is there a simpler or better way to do this?
Thanks for any ideas and comments!
greetings,
Uli

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [ADMIN] How do I grant access to entire database at once(schemas,tables,sequences,...)?

2004-05-17 Thread Peter Eisentraut
Ulrich Meis wrote:
 1. Write a script that queries the postgres internal tables for all
 tables,schemas,sequences,views,functions,... and then executes grant
 statements for each one of them. This would have to repeated each
 time a new object is created.

Yes, that's the most popular method so far.  You could also write a 
stored procedure.

 2.(Not sure if this works) Insert a trigger on postgres's internal
 tables in template1 that grants permission to a group say
 dbname_group to the created object. Developers that need access to
 the database can then be added to that group.

Triggers on system tables don't work.


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly