Issue: c&p changes attributes to text

Version info

Ubuntu, LTR-version with ubuntu-gis dependencies.

QGIS-Version 2.18.24
QGIS-Codeversion ff5bd09
Kompiliert gegen Qt 4.8.7
Laufendes Qt 4.8.7
Kompiliert mit GDAL/OGR 2.2.2
Läuft mit GDAL/OGR 2.2.2
Kompiliert mit GEOS 3.5.1-CAPI-1.9.1
Läuft mit GEOS 3.5.1-CAPI-1.9.1 r4246
PostgreSQL-Client-Version 9.5.2
SpatiaLite-Version 4.3.0a
QWT-Version 5.2.3
PROJ.4-Version 492
QScintilla2-Version 2.9.1

Example files

The demo files of the output below can be downloaded here:

https://pages.martinweis.eu/m/qgis/cpbug/cpbug.zip

This document can be found here: https://pages.martinweis.eu/m/qgis/cpbug/

dbfinfo output

$ dbfinfo all_attr_types_pt.dbf

Info for all_attr_types_pt.dbf
12 Columns,  1 Records in file
       datetime          string  (24,0)
         int16b         integer  (10,0)
         int32b         integer  (10,0)
         int64b           float  (20,0)
           text          string  (254,0)
           date          string  (8,0)
           time          string  (12,0)
        numeric           float  (11,3)
        decimal           float  (11,3)
           real           float  (24,15)
         double           float  (24,15)
        integer         integer  (10,0)

$ dbfinfo pasted

Info for pasted.dbf
12 Columns,  1 Records in file
       datetime          string  (254,0)
         int16b          string  (254,0)
         int32b          string  (254,0)
         int64b          string  (254,0)
           text          string  (254,0)
           date          string  (254,0)
           time          string  (254,0)
        numeric          string  (254,0)
        decimal          string  (254,0)
           real          string  (254,0)
         double          string  (254,0)
        integer          string  (254,0)

Screenshots

Original attributes (before)

Original attributes (before)

Pasted attributes (after)

Pasted attributes (after)

Additional info

QGIS-Version 3.4.1-Madeira QGIS-Codeversion 383851c

Bernd added:

Ich hatte das Problem, dass bei mehreren aufeinander folgenden Spalten vom Typ Integer immer wieder einige als String interpretiert wurden. Dieses Problem tritt nach meinen Recherchen schon seit geraumer Zeit (ab 2.6) auf und betreffen grundsätzlich Spalten vom Typ “qlonglong”. Falls du keine Zahlen von > 99.999.999 in Tabellen aufnehmen musst, so kannst du die Länge der Ganzzahlenspalte auf 8 einstellen. Hierdurch wird unter Python der Typ “int” verwendet, anstatt “qlonglong” und sollten richtig übernommen werden.