1

In our administration, each employee is given various rights to read and edit data on the PostgreSQL/PostGIS database. To view the geodata, we use QGIS. In this case there should be read permissions on only 3 columns. The rest should not be seen by the user. In PgAdmin I have distributed the permissions as follows:

GRANT SELECT(name) ON test.krankenhaus_test TO r_test;
GRANT SELECT(geom) ON test.krankenhaus_test TO r_test;
GRANT SELECT(krankenhaus_id) ON test.krankenhaus_test TO r_test;

Unfortunately I cannot see this table in QGIS. We use PostgreSQL 13.7 and QGIS 3.22.10. When I assign a grant select to the full table, I get the complete table displayed in QGIS.

GRANT SELECT ON TABLE test.krankenhaus_test TO r_test;

However, as I said, I only want to be able to see the three columns.

5
  • 4
    Use a view on just the permitted columns
    – Vince
    Commented Sep 28, 2023 at 11:28
  • 2
    View feels like a good option. But if you turn on the SQL statement logging in PostgreSQL you can see the queries that QGIS is sending and then you can consider what other rights you should give for your users.
    – user30184
    Commented Sep 28, 2023 at 11:51
  • 1
    Did you try unchecking the only show tables with geometry box?
    – Ian Turton
    Commented Sep 28, 2023 at 12:39
  • 1
    Make sure you add the layer via query from the DB Manager and not directly from Layer>Add PostGIS Layer
    – OGmaps
    Commented Sep 29, 2023 at 14:57
  • 1
    It actually worked via the DB Manager. So this seems to be a QGIS bug? Commented Oct 2, 2023 at 13:01

0

Your Answer

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

Browse other questions tagged or ask your own question.