Bug report #2187

"Could not commit changes to layer..." and "duplicate key value violates..." errors when committing changes in postgis

Added by Giovanni Manghi over 14 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12247

Description

This ticket was open after the observations made here

http://lists.osgeo.org/pipermail/qgis-developer/2009-December/008552.html

To replicate:
use the "regions" layer you can find in the spatialite sample dataset: you can save it as shapefile and import to postgis. Tested also with other layers, like the "world borders" vector.

In qgis trunk (but not in 1.3) after merging non adjacent or non overlapping features (or features with islands) of a postgis layer, after toggling editing to save changes, the program returns

"ERROR: duplicate key value violates unique constraint "regions_pkey""

and after that

"Could not commit changes to layer regions
Errors: ERROR: 1 feature(s) not added.
SUCCESS: 2 feature(s) deleted."

If the same is done on a spatialite layer only the latter message is shown (again, only in trunk, not in 1.3).

History

#1 Updated by Giovanni Manghi over 14 years ago

meanwhile the problem seems to have been solved in spatialite, not yet in postgis

#2 Updated by Giovanni Manghi over 14 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

#3 Updated by Giovanni Manghi over 14 years ago

probably fixed by 58c68efc (SVN r12419)

Also available in: Atom PDF