Bug report #21714
Exported GeoPackages have wrong field definitions
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Alessandro Pasotti | ||
Category: | Data Provider | ||
Affected QGIS version: | 3.7(master) | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 29530 |
Description
Fields created for string values are set to length=255 even if they contain much longer texts:
To reproduce:
- Load lakes.shp from QGIS sample data
- Export to CSV, adding geom as WKT
- Export CSV layer to GeoPackage -> The resulting field definitions are shown in the following screenshot
The resulting GeoPackage is problematic. Due to the wrong field definitions, e.g. the data cannot be imported into PostGIS using DBManager:
Error 6 Feature write errors: Creation error for features from #0 to #0. Provider errors was: PostGIS error while adding features: FEHLER: Wert zu lang für Typ character varying(255) Only 0 of 15 features written.
Related issues
Associated revisions
Fix wrong field length in file writer
fixes #21714
History
#1 Updated by Alessandro Pasotti over 5 years ago
- Assignee set to Alessandro Pasotti
#2 Updated by Alessandro Pasotti over 5 years ago
- Resolution set to fixed/implemented
- Pull Request or Patch supplied changed from No to Yes
- Status changed from Open to In Progress
#3 Updated by Alessandro Pasotti over 5 years ago
- % Done changed from 0 to 100
- Status changed from In Progress to Closed
Applied in changeset qgis|013bdf9405ae428e8ea5ce38f272f0cdfaaa2ee8.
#4 Updated by Alessandro Pasotti over 5 years ago
- Duplicated by Bug report #21840: Geopackage - wrong string length added