How to do it...

In the preceding recipe, we imported several rasters and shapefiles to their respective tables. By default, access to those tables is restricted to only the user who performed the import operation, also known as the owner. The following steps permit other users to access those tables:

  1. We need to create several groups and users in order for this recipe to demonstrate and test the privileges set in the chapter10 database by executing the following commands:
      CREATE ROLE group1 NOLOGIN;
      CREATE ROLE group2 NOLOGIN;
      CREATE ROLE user1 LOGIN PASSWORD 'pass1' IN ROLE group1;
      CREATE ROLE user2 LOGIN PASSWORD 'pass2' IN ROLE group1;
      CREATE ROLE user3 LOGIN PASSWORD 'pass3' IN ROLE group2;

The first two CREATE ROLE statements create ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.