I am editing a layer's (Z) attribute table. I made some columns, used the field calculator to fill them up, made some more, went back and deleted some and then tried to save the edits and got the error message: "Could not commit changes to layer Z. Errors: ERROR: 3 attributes not deleted. Success 2 attributes added Success: 10 attribute values changed" Then I closed the error box and the layer remains in edit mode and one can't save it. I tried to save the Z layer and got the same "Could not ..." but also with "OGR error deleting field 3: Invalid field address" I saved the project and then reloaded the project to find that all the columns in layer Z had been wiped out except an ID layer. The layer Z is ruined. v 1.8.0. What is going on? - thanks.

  • Likely an OGR issue, not a qgis one. Aug 16, 2012 at 10:34

2 Answers 2


You should save your data after each creation or deletion of fields. For the broken layer, you can try to open the .dbf file with OpenOffice Calc.

  • I tried opening what was left in Excel and Open Office, the file was toast. Saving after every column entry sounds reasonable. So the .shp file's .dbf is not altered (the table is in memory) until is is saved? Seems some operations work on the original file whether one saves or not, otherwise a save is required. Is that correct?
    – HealthMaps
    Aug 16, 2012 at 20:23
  • All your edits on geometry and attribute table remain in memory until you press the Save Button. So if you made a mistake, you can always leave without saving.
    – AndreJ
    Aug 17, 2012 at 5:07
  • You are definitely correct to recommend saving after each edit. However there seems to be some bugs in the table calculation capability or I am still green enough that I do not understand how it really works. Some of both I think. As of now, I do not see the value of the default to integer arithmetic needing to multiply by 1.0 to get floating point results. No other software I use works this way.
    – HealthMaps
    Aug 18, 2012 at 17:19

I was having the same issue of 'could not commit changes' after editing polygons in a shapefile. The only way I found around this was to copy the polygons into a new shape file, which seemed to resolve the issue preventing the file from saving with those polygons. I ended up editing in one file, then copying and saving in the master shape file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.