Bug report #5758
Primary key issue when using merge attributes of selected features tool
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | Jürgen Fischer | ||
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 #: | 15262 |
Description
It seems if one uses the merge attributes of selected features tool there is no way to exclude certain columns, specifically the primary key columns. The result is that all selected features get the same primary key values, which results in a duplicate primary key issue.
It is proposed to add an additional merge way that tells QGIS to ignore this particular columnn and keep the original primary keys of the individual original features.
Other proposals are also welcome.
Related issues
Associated revisions
merge attributes: new vector api can skip attributes - use default value for skipped field (fixes #5758)
History
#1 Updated by Andreas Neumann over 12 years ago
#5475 is a similar open bug with splitting features. Related to the primary key problem.
#2 Updated by Andreas Neumann over 12 years ago
actually this other but is not open any more. It was decided to use the default values.
#3 Updated by Jürgen Fischer over 12 years ago
- Status changed from Open to Closed
Fixed in changeset 2d722b1a56c45b6a34269aceffc4912f92ab9a72.
#4 Updated by Alexandre Neto almost 11 years ago
- Target version changed from Version 1.8.0 to Future Release - High Priority
- Status changed from Closed to Reopened
I still have this problem with "merge attributes of selected features".
I'm trying to make it work in a Postgis table, with the primary key defined like this:
gid integer NOT NULL DEFAULT nextval('epvu.sgev_temp_gid_seq'::regclass)
When I use "merge attributes of selected features" with any two features, even with "skip attribute" option on gid, the value is set to NULL. I would expect it to set the default value "nextval('epvu.sgev_temp_gid_seq'::regclass)" or keep the original gid values in each selected feature.
#5 Updated by Alexandre Neto almost 11 years ago
This is the error I get when trying to save my changes:
Could not commit changes to layer sgev
Errors: ERROR: 2 attribute value change(s) not applied. Provider errors: PostGIS error while changing attributes: ERROR: null value in column "gid" violates not-null constraint DETAIL: Failing row contains (null, 0106000020656B000001000000010300000002000000A9000000292FEDF01E6C..., SDR014, null, S. Domingos de Rana, Abóboda, Praça David Mourão Ferreira/ R. Antonio Machado, Urbanização da Abóboda, Nuno Louro, EMAC, 82,84, Sem rega, null, null, Manter, null, SOGRAMA_PeC, 12/1/2008, null, -9:19:45.757, 38:43:36.654, 444.210813630014, 789967, null, null, null, null, null, null, null, Passeio_caminho, SOGRAMA, S31, 2163, 0, 0, null, yes , 2013-11-21 10:00:25.12, null).
#6 Updated by Giovanni Manghi almost 11 years ago
- Operating System deleted (
all) - Target version changed from Future Release - High Priority to Version 2.2
I can confirm that this was working as expected in QGIS 1.8 and does not on master.
#7 Updated by Jürgen Fischer almost 11 years ago
- Status changed from Reopened to Closed
Fixed in changeset 28fb634876ac411a2d3c27ae1fa259b77043596b.