Ticket #955 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

PostGIS view only accessible by superuser or table owner

Reported by: best Owned by: jef
Priority: major: does not work as expected Milestone:
Component: Data Provider Version: 0.9.1
Keywords: Cc:
Platform Version: Platform: All
Must Fix for Release: No Awaiting user input: no

Description

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

Change History

Changed 5 years ago by smizuno

I have submitted a patch on ticket #964 that addresses this along with internationalization and a number of other problems.

Changed 5 years ago by jef

  • owner changed from nobody to jef

Changed 5 years ago by jef

  • status changed from new to closed
  • resolution set to fixed

Changed 5 years ago by jef

fixed in r8213

Note: See TracTickets for help on using tickets.