Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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:
Component: Data Provider Version: 0.9.1
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: 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

Change History (4)

comment:1 by smizuno, 15 years ago

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

comment:2 by jef, 15 years ago

Owner: changed from nobody to jef

comment:3 by jef, 15 years ago

Resolution: fixed
Status: newclosed

comment:4 by jef, 15 years ago

fixed in r8213

Note: See TracTickets for help on using tickets.