Bug report #9008

Postgis: commit errors leads to loosing data

Added by Regis Haubourg about 10 years ago. Updated almost 6 years ago.

Category:Data Provider/PostGIS
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:17663


When editing data in attribute view, if commit is raising error, there is no way to save pending edits.
More precisely, two cumulated problems:

  1. when trying to edit text longer than column type (character varying 150, typing 200 character values), commits raise error. Every other software raises a warning and then truncate values to max possible length.
  2. editing in full screen attribute view, soft error bar is not show (they raise in main window), then 8 save actions where logged in error, but I didn't see them from the attribute view, I lost 2 hours work on a field. Saving pending edits in another format is not possible, since qgis reads datasource when exporting, and not in memory edits. The only way I could have save my work was using a copy-paste action to a spreadsheet.

RESULT: When should find a way to show errors logs on save in attribute view also. Provider should try to truncate the values to the size of field. I one value is too long, the whole table can't be saved!


#1 Updated by Giovanni Manghi about 10 years ago

Hi Regis,
it would be interesting to check if this was an issue also in qgis 1.8, then if not tag this a regression.


#2 Updated by Jürgen Fischer about 10 years ago

If the provider is capabable to determine a maximum length, QGIS should already not allow to enter more data. And if it can't, it cannot truncate the field to the allowed size either (and it IMHO shouldn't anyway. I also doubt that every other software would do so). QGIS also doesn't discard pending changes that cannot be saved unless you tell it to. You still can update your edits to make them fit and save them, but I admit that it can be hard to know which changes are actually the problem.

And QGIS should still use the changed data while the edits are not committed, so "Save as..." should have been possible.

#3 Updated by Antonio Locandro over 9 years ago

I am wondering if the Commit error bar will be added to the attribute tables like suggested, currently it just won't save but to see the error flag one has to go back to canvas.

#4 Updated by Jürgen Fischer over 8 years ago

  • Category changed from Data Provider to Data Provider/PostGIS

#5 Updated by Giovanni Manghi over 6 years ago

  • Regression? set to No
  • Easy fix? set to No

#6 Updated by Regis Haubourg almost 6 years ago

  • Resolution set to fixed/implemented
  • Description updated (diff)
  • Status changed from Open to Closed

This is fixed!

Also available in: Atom PDF