Bug report #13877
Avoid modification of PostGIS table without primary key
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21900|
Add to QGIS a PostGIS layer without primary key (I added a point one).
Toggle to edition such a file remains possible. Do it.
You'll see that the only available tools for edit are "Save modifications" and "Add a feature". And indeed, you can add new features, set their attributes and save with no problem (and these changes are applied in the database). BUT:
- You can't change attributes of already existing features
- since all other tools are not available, there's no way to change geometries (move, add part, remove..)
- In the table I use there's a serial column. This field needs the attribute table dialog to be closed before it shows new values.
Is there a reason to allow modification with so many restrictions?
#3 Updated by Jürgen Fischer over 4 years ago
Harrissou Santanna wrote:
Yes, I suspected that. So shouldn't it rather be impossible to the user to toggle this layer into edition?
It's weird to have the layer editable with this strange behaviour... Are there use cases of this behaviour?
Sure, you might have been granted only INSERT right, but not DELETE or UPDATE. That would look the same.