Skip to content
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

ERROR: duplicate key value violates unique constraint... #15579

Closed
qgib opened this issue Aug 29, 2012 · 4 comments
Closed

ERROR: duplicate key value violates unique constraint... #15579

qgib opened this issue Aug 29, 2012 · 4 comments
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
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Aug 29, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 6279
Affected QGIS version: master
Redmine category:db_manager
Assignee: Giuseppe Sucameli


When importing a vector into PostGIS with DB manager, if the original vector has already a column "id" then the tool will give

Creation error for features from #0 to #0. Provider errors was:
PostGIS error while adding features: ERROR: duplicate key value
violates unique constraint "table_name_pkey"
DETAIL: Key (id)=(0) already exists.

As "id" is very common (unless the old "gid") I guess that a check should be added before trying to import the vector.

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was configured as Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Nov 28, 2012

Author Name: Giuseppe Sucameli (@brushtyler)


Fixed in changeset "0239795d7931b614be22e87d12beecf20372b5c6".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Nov 28, 2012

Author Name: Giuseppe Sucameli (@brushtyler)


Now the new field name is not passed from DBManager to the provider unless the user tick the "primary key" checkbox.
The provider checks the field name list and chooses a different name whether the default one (i.e. "id") exists yet.

@qgib
Copy link
Contributor Author

qgib commented Nov 28, 2012

Author Name: Giuseppe Sucameli (@brushtyler)


Fixed for QGis Friendly Courses http://www.qgis.org/en/sponsorship/qgis-friendly-courses.html


  • resolution was changed from to fixed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
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
Projects
None yet
Development

No branches or pull requests

1 participant