You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user has only INSERT privileges on a PostGIS table then he/she cannot save edits because the feature form that pop up after digitizing the geometry does not allow any data entry.
If the table has some defaults set up (like for example the one for the unique PK field) so that mandatory fields are auto-filled then saving edits is possible, clearly demonstrating is not a DB/privileges issue. In this case there is also another issue as the "save edits" icon/button is active in the table of attributes but not in the digitizing toolbar.
Moreover QGIS allows create and save new geometry-less features added from the the attribute table (as there manually entering attributes for the new feature is possible). The same inconsistency with the save button as the previous case occurs.
Old description
When using PostGIS layer users having only select and "INSERT" privileges on that table, there is disabled attribute form showing after geometry drawing. Form occurs but user can't input any values. On the other hand user can insert attributes via attribute table (without geometry) or using form's default values so it is not a database issue. Above form is getting available only when "UPDATE" database privilege is set. So in effect it is not possible to define a user that can only add new features with attributes without permissions of editing existing rows.
How to Reproduce
Create database table with geometry (e.g. point_layer) and at least one extra column (varchar, integer, etc)
Create database user (e.g. test_user) and give him SELECT and INSERT privileges on that table
Connect to the database with QGIS Desktop as test_user and add point_layer to map
Turn on edition mode on point_layer
Add a new feature on a map
Attribute form shows but entering data is not possible, preventing for example entering manually the mandatory PK values and thus preventing saving edits
QGIS and OS versions
Windows, Linux, QGIS 3.16 and 3.10
Additional context
QGIS seems that wants the tables to have also the UPDATE privilege to enable entering new features while the INSERT privilege should be enough.
The text was updated successfully, but these errors were encountered:
gioman
changed the title
Disabled attribute form when inserting feature with postgres insert privilage
Cannot save edits on PostGIS table when user has only the INSERT privilige
Jan 10, 2021
@envirosolutionspl I extensively edited your title and description to make the problem clearer.
gioman
changed the title
Cannot save edits on PostGIS table when user has only the INSERT privilige
Cannot enter attributes and save edits on PostGIS table when user has only the INSERT privilige
Jan 10, 2021
New description
When a user has only INSERT privileges on a PostGIS table then he/she cannot save edits because the feature form that pop up after digitizing the geometry does not allow any data entry.
If the table has some defaults set up (like for example the one for the unique PK field) so that mandatory fields are auto-filled then saving edits is possible, clearly demonstrating is not a DB/privileges issue. In this case there is also another issue as the "save edits" icon/button is active in the table of attributes but not in the digitizing toolbar.
Moreover QGIS allows create and save new geometry-less features added from the the attribute table (as there manually entering attributes for the new feature is possible). The same inconsistency with the save button as the previous case occurs.
Old description
When using PostGIS layer users having only select and "INSERT" privileges on that table, there is disabled attribute form showing after geometry drawing. Form occurs but user can't input any values. On the other hand user can insert attributes via attribute table (without geometry) or using form's default values so it is not a database issue. Above form is getting available only when "UPDATE" database privilege is set. So in effect it is not possible to define a user that can only add new features with attributes without permissions of editing existing rows.
How to Reproduce
QGIS and OS versions
Windows, Linux, QGIS 3.16 and 3.10
Additional context
QGIS seems that wants the tables to have also the UPDATE privilege to enable entering new features while the INSERT privilege should be enough.
The text was updated successfully, but these errors were encountered: