Ticket #955 (closed enhancement: fixed)
PostGIS view only accessible by superuser or table owner
|Reported by:||best||Owned by:||jef|
|Priority:||major: does not work as expected||Milestone:|
|Must Fix for Release:||No||Awaiting user input:||no|
Only a DB-superuser and the owner of the underlying table can access a PostGIS view. Everybody else gets a message stating there was no suitable key column in the view. This message led me to qgspostgresprovider.cpp which accesses information_schema.view_column_usage. However Postgres documentation states
... A column is only included if the table that contains the column is owned by a currently enabled role.
I logged into a Postres-DB three times and executed
SELECT * FROM information_schema.view_column_usage WHERE view_name = <name_of_the_view>
- as non-superuser with select rights on the tables and views: SELECT returned no results.
- as the table owner (non-superuser) SELECT returns all columns
- as superuser (non-table-owner) SELECT returns all columns