Bug report #21809

when pasting features to postgresql layer, attributes that are a primary key do not have the values pasted

Added by Sebastian Brocks 7 months ago. Updated 7 months ago.

Status:Feedback
Priority:Normal
Assignee:-
Category:Editing
Affected QGIS version:3.6.1 Regression?:No
Operating System:windows 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29624

Description

I'm trying to paste a few features into a postgresql layer that has two attributes that together form the table's primary key. The values of the attributes are not pasted correctly, although both name and order and type match.

paste_error.png (29.1 KB) Sebastian Brocks, 2019-04-11 09:14 AM

History

#1 Updated by Giovanni Manghi 7 months ago

  • Status changed from Open to Feedback

Can you please detail the precise steps to replicate (also the sql used to create the table and the PK with the a attributes), thanks!

#2 Updated by Sebastian Brocks 7 months ago

Here's the sql for the table:

CREATE TABLE public.nullpunkt(
nummer integer NOT NULL,
bezeichnung varchar(1) NOT NULL,
geometrie geometry(POINT, 4326),
CONSTRAINT nullpunkt_pk PRIMARY KEY (nummer,bezeichnung)

);

I have a temporary scratch layer with a few point features with two attributes, one integer of length 10, and one string of length 1.
When I try to paste point featuers into the nullpunkt layer, the attribute values are not pasted correctly. for the first two features that are pasted, the number is correct, the other features don't have the correct number. the string is incorrect for all.

#3 Updated by Giovanni Manghi 7 months ago

I have a temporary scratch layer with a few point features with two attributes, one integer of length 10, and one string of length 1.

do they have the same name as the postgis table?

#4 Updated by Sebastian Brocks 7 months ago

Yes they do

#5 Updated by Sebastian Brocks 7 months ago

See the attached picture: "Pasted" contains the features I want to copy into "nullpunkt". What you see in nullpunkt is the result of pasting the features that are selected in "Pasted" into "nullpunkt"

#6 Updated by Giovanni Manghi 7 months ago

Sebastian Brocks wrote:

See the attached picture: "Pasted" contains the features I want to copy into "nullpunkt". What you see in nullpunkt is the result of pasting the features that are selected in "Pasted" into "nullpunkt"

I cannot replicate here.

Also available in: Atom PDF