-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
return a more meaningful error when column name is duplicated #15205
Comments
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Giovanni Manghi (@gioman) it works if I check the "primary key" checkbox and change it to something else then "id", that in fact is a column name already there in the original shapefile. Why db manager chooses to give by default the postgis id as "id" and not "gid" as usual? Same thing for the geometry column, why "geom" instead "the_geom"?
|
Author Name: Giuseppe Sucameli (@brushtyler) I cannot change the error message: that's the string retured by the DBMS and then the provider. What I can do is to change the default pk and geometry fields' name. |
Author Name: Giovanni Manghi (@gioman) Giuseppe Sucameli wrote:
gid is (was) a good choice, but why not adding a check before importing the vector, and if the case throw and error like "the column XXX already exist". |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 5642
Affected QGIS version: master
Redmine category:db_manager
The attached shapefile does not gives any particular problem (except encondig) when loading it into postgis using ogr2ogr, shp2pgsql, spit and postgis manager, but with db manager it always fails with
@error 7
Feature write errors:
Creation error for features from #0 to #10258. Provider errors was:
PostGIS error while adding features: ERROR: duplicate key value violates unique constraint "alt4_pkey"
Only 1 of 201 features written.@
The text was updated successfully, but these errors were encountered: