-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improper cast of textual primary key during import with DB Manager #55856
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
DB Manager
Relating to the DB Manager core plugin
PostGIS data provider
Comments
alhyss
added
the
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
label
Jan 16, 2024
agiudiceandrea
added
DB Manager
Relating to the DB Manager core plugin
PostGIS data provider
labels
Jan 16, 2024
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 7, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 7, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 7, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 7, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 7, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
nyalldawson
pushed a commit
that referenced
this issue
Feb 8, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issues is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: #55856
ptitjano
added a commit
to ptitjano/QGIS
that referenced
this issue
Feb 8, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issue is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: qgis#55856
nyalldawson
pushed a commit
that referenced
this issue
Feb 8, 2024
The `lowercaseFieldNames` allows to transform the column names to lowercase. If this option is enabled, then the requested primary key (`primaryKey`) is in lowercase but the `fields` are not. Therefore, the requested primary key will never be found. This issue is fixed by converting the field names to lowercase when looking for the primary key if the option is enabled. Closes: #55856
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
DB Manager
Relating to the DB Manager core plugin
PostGIS data provider
What is the bug or the crash?
I want to import a layer into a PostGIS database using DB Manager, with a custom field as primary key and the "Convert field names to lowercase" option. In QGIS, the field in question is typed as text. Though most values are integers, two records have non-numerical values
'2A'
and'2B'
.While importing the layer, DB Manager apparently tries to cast the field as integer (serial), which fails with an "invalid syntax for type integer" error.
Importing the layer with the custom primary key works if I don't convert the field names to lowercase. Importing the layer with lowercase field names works if I don't declare the field as primary key.
Steps to reproduce the issue
Download the official list of French departments.
Load the file into QGIS with
Layer
>Add Layer
>Add Delimited Text Layer
(encoding UTF-8, format CSV, no geometry).Open DB Manager.
Click on
Import Layer/File
and import the layer into a PostGIS database with the following options:Versions
PostgreSQL 13.7
QGIS :
Supported QGIS version
New profile
Additional context
No response
EDIT: with QGIS 3.34.2.
The text was updated successfully, but these errors were encountered: