4

I've created user profiles for my teammates to connect to my postGIS database with QGIS.

with my own user account I am able to successfully connect to my postGIS database on AWS RDS using QGIS 2.18.

user creation SQL:

CREATE USER foobar WITH
    LOGIN
    NOSUPERUSER
    NOCREATEDB
    NOCREATEROLE
    INHERIT
    NOREPLICATION
    CONNECTION LIMIT -1
    PASSWORD 'xxxxxx';

And granted permissions:

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA test TO foobar;

Am I missing a step? When I connect in QGIS, I only see an empty public schema. enter image description here

EDIT: In addition to the accepted answer, one can also change the default privileges so newly created tables are shown automatically in QGIS:

ALTER DEFAULT PRIVILEGES IN SCHEMA test GRANT ALL ON TABLES to foobar;

1 Answer 1

7

You also need to grant usage on your schema:

GRANT USAGE ON SCHEMA test TO foobar;
1
  • 2
    If for some reason PostGIS extension has been installed under different schema than the default public then the user also needs access to that schema. For example, if the PostGIS extension has been installed under the schema postgis then one has to run the query: GRANT USAGE ON SCHEMA postgis TO foobar;. I am not sure, why one would use different than the public schema for the PostGIS extension but probably there can be reasons. Jun 7, 2019 at 7:49

Your Answer

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

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