Bug report #6164
postgis layer: duplicate primary key
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | - | ||
Category: | Digitising | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 15485 |
Description
When I try to copy one feature from a postgis layer to another (or to the same layer), the value of the primary key (integer serial) is copied as it is, generating a duplicate key error:
Errors: ERROR: 1 feature(s) not added. Provider errors: PostGIS error while adding features: ERROR: duplicate key value violates unique constraint "grafo_pk" DETAIL: Key (ogc_fid)=(2630) already exists.
The same thing if I hide the pk field in the "Fields" property of the layer, to tell QGIS not to use it for copying.
Affected version: master and 1.8
Whith 1.7.4 it was working correctly!
Related issues
Associated revisions
[API] make primary key field indexes available:
- add QgsVectorLayer::pendingPkAttributeList()
- add QgsVectorDataProvider::pkAttributeIndexes()
- skip primary key attribute when pasting features (fixes #6164)
- default to skip primary key attribute in when merging features/attributes
- reset primary key attributes to default value when splitting features (better fix for #6060)
- comment out unused QgsPasteTransformations
History
#1 Updated by Giovanni Manghi over 12 years ago
- Status changed from Open to Feedback
Did you tested qgis-master? please give it a try and report back, thanks.
#2 Updated by michele zanolli over 12 years ago
Giovanni Manghi wrote:
Did you tested qgis-master? please give it a try and report back, thanks.
michele zanolli wrote:
Affected version: master and 1.8
With 1.7.4 it was working correctly!
#3 Updated by Giovanni Manghi over 12 years ago
- Priority changed from Normal to Severe/Regression
michele zanolli wrote:
Affected version: master and 1.8
With 1.7.4 it was working correctly!
sorry, I overlooked your answer.
Anyway it should be a regression so I'll tag this as blocker.
#4 Updated by Jürgen Fischer almost 12 years ago
- Status changed from Feedback to Closed
Fixed in changeset 2a002c558e923d51142ca1e4c280b2e58826b291.