Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2187 closed bug (fixed)

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

Reported by: lutra Owned by: nobody
Priority: critical: causes crash or data corruption Milestone: Version 1.4.0
Component: Data Provider Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

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).

Change History (3)

comment:1 by lutra, 14 years ago

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

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

comment:2 by lutra, 14 years ago

Resolution: fixed
Status: newclosed

comment:3 by lutra, 14 years ago

probably fixed by r12418

Note: See TracTickets for help on using tickets.