Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to cram three different organisations into one server. Today they each have their own geoserver instance connected to separate PostGIS databases, which works fine. But now they also need to be able to access and manipulate their own data and I can't figure out how to set this up.

So in short: How do I set up three different users in PostGIS and grant them access to one specific database each?

Any suggestions welcome

/O

share|improve this question
    
Is there a reason you want to administer roles and privileges per table rather than per schema? –  Scro Aug 28 '12 at 15:53
    
Yes, a simple one. It is much easier to tell the customer he has his own database than access to a specific schema. –  oht Jan 15 '13 at 5:43
add comment

1 Answer 1

up vote 2 down vote accepted

The easiest would be to setup PostgreSQL user group roles and assign permissions based on those roles. It's a lot easier in PostgreSQL 9.0+ since you can use DEFAULT PRIVILEGES.

--this will take care of future tables in a database

 ALTER DEFAULT PRIVILEGES GRANT ALL ON TABLES TO gisadmins;

-- this will take care of existing tables in public schema. As I recall for existing I think you have to do it schema by schema

GRANT ALL ON ALL TABLES IN SCHEMA public TO gisadmins;
share|improve this answer
    
Thanks, worked fine! –  oht Oct 22 '12 at 19:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.