Bug report #9844
postgis: if owner is a group it is not possible to add/remove columns (in field calculator or vector properties) but DB manager can
| Status: | Closed | ||
|---|---|---|---|
| Priority: | Normal | ||
| Assignee: | |||
| Category: | Data Provider/PostGIS | ||
| Affected QGIS version: | master | Regression?: | No | 
| Operating System: | Easy fix?: | No | |
| Pull Request or Patch supplied: | No | Resolution: | |
| Crashes QGIS or corrupts data: | No | Copied to github as #: | 18374 | 
Description
Take a PostGIS db and add a group, then grant this group to a user(s) and then grant the ownership of a table to the group:
- as expected DB manager can add/remove columns (so actually making an "alter table") as do does pgadmin
 - using the field calculator (or the vector properties -> fields tab) it is not possible to add/remove columns
 
Related issues
Associated revisions
postgres provider: improve owner check (fixes #9844)
History
#1
    
    Updated by Yves Jacolin over 11 years ago
    Hello,
Not sure if this issue is link to this but I have an another use case:
- Take a PostGIS db and then grant the ownership of a table to user "X", GRANT right to "Y" to allow modification of the table's structure
 - connect to this DB with user "Y" in QGIS
 - DB Manager and QGIS (fields tab in properties windows) can't modify the structure of the table
 - PgAdmin connected with user "Y" can modify the table
 
Regards,
Y.
#2
    
    Updated by Giovanni Manghi over 11 years ago
    Yves Jacolin wrote:
Hello,
Not sure if this issue is link to this but I have an another use case:
- Take a PostGIS db and then grant the ownership of a table to user "X", GRANT right to "Y" to allow modification of the table's structure
 - connect to this DB with user "Y" in QGIS
 - DB Manager and QGIS (fields tab in properties windows) can't modify the structure of the table
 - PgAdmin connected with user "Y" can modify the table
 
I'm not a postgresql/postgis guru, but I always assumed that (example) a GRANT ALL is not enough to allow a user/group change a table structure. The ownership is mandatory. In this sense I would be surprised if pgamdin allows to modify the table structure for a user/group without ownership. Is this the case?
#3
    
    Updated by Jürgen Fischer over 11 years ago
    - Target version changed from Version 2.4 to Future Release - High Priority
 
#4
    
    Updated by Jürgen Fischer almost 11 years ago
    - Status changed from Open to Closed
 
Fixed in changeset f8f2713571f9690ffe8b5b643c939c0c0c1650f5.