2

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

2
  • Is there a reason you want to administer roles and privileges per table rather than per schema?
    – Scro
    Aug 28, 2012 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, 2013 at 5:43

1 Answer 1

4

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;
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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