Feature request #12722

Allow copy/paste of columns between tables also when columns do not have the same order

Added by Patrick Dunford over 5 years ago. Updated about 3 years ago.

Status:Feedback
Priority:Normal
Assignee:-
Category:Attribute table
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:20824

Description

new description:
#12722-6


old description:

I have a number of projects where I am combining several tables together by copying and pasting data between tables. The source table has two string columns and the destination table has two string columns and a integer column. The string columns are all the same length of 80 characters. Sometimes the paste will result in all of the destination columns of the newly pasted records being nulled in the destination table.

I have not been able to identify a consistent pattern of this occuring so it is difficult or impossible to reproduce. I recall that in an earlier version of Qgis the table paste was recoded to null out some columns to deal with errors of data conversion.

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback
  • Category set to Vectors

the columns do have the same datatype and name?

#2 Updated by Saber Razmjooei over 5 years ago

  • Status changed from Feedback to Closed

Not possible to reproduce. The ticket is closed, but feel free to reopen and provide some data to reproduce the problem.

#3 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to not reproducable

#4 Updated by Harrissou Santanna almost 5 years ago

  • Status changed from Closed to Reopened

I think I reproduce it.
I have a PostGIS table A that I "saved as" a shapefile B, with "only selected features" option checked
My new layer B has the expected features with their attributes (field name is identical and values are well retrieved).
Now, copy paste another feature from the source layer A into B. This new feature has NULL attributes.
IMHO, Should be set as blocker.
master fea4ed9

#5 Updated by Patrick Dunford almost 5 years ago

I use file based layers and I see it all the time.
I have been on the case of cross table paste issues for some time. It used to be when pasting from one table to another you would get crashes. My understanding was this was worked around at some point by pasting nulls instead (in other words you can still paste a visible feature from one table to another, but any of the table values will be cleared when pasting).

Whether this is still the case that those columns are nulled on paste, I do not know. All my tables are using string values and it seemed to me while pasting other types of values could cause conversion errors, pasting one string to another shouldn't cause a problem.

#6 Updated by Patrick Dunford over 4 years ago

There has been an improvement with 2.12 in seeing that pastes work most of the time provided the source table columns are in the same order in the destination table
e.g. source columns are A and B, destination columns are A B and C, the source columns get pasted correctly into the destination table.
However I believe it should also work for the scenario where the columns have the same names but are in a different order.
e.g. if the source is A B and the destination is A D E B C then all the columns are pasted as nulls. It should be possible to find the column of the same name and paste into it if the type and size match.

#7 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Reopened to Feedback
  • Resolution deleted (not reproducable)

However I believe it should also work for the scenario where the columns have the same names but are in a different order.

but this would be a feature request, agree?

#8 Updated by Giovanni Manghi over 4 years ago

  • Category changed from Vectors to Attribute table
  • Tracker changed from Bug report to Feature request
  • Subject changed from Paste from one table to another results in nulls in all fields to Allow copy/paste of columns between tables also when columns do not have the same order
  • Operating System deleted (Windows)
  • OS version deleted (8.1 (6.3 9600))

#9 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No

#10 Updated by Jürgen Fischer about 3 years ago

  • Description updated (diff)

Also available in: Atom PDF