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

duplicate key value violates unique constraint "geometry_columns_pk #40

Open
GeoTimber opened this issue Jun 19, 2014 · 1 comment
Open

Comments

@GeoTimber
Copy link

Hello, when I update the mapping file (based on osm bright template) to add some features to a table that were not included previously imposm crashed when i reimport the OSM PBF. Just after the vacuum analyze it dumps me:

Vacuum analyze
[16:10:16] optimizing took 13s
Traceback (most recent call last):
File "/usr/local/bin/imposm", line 9, in
load_entry_point('imposm==2.5.0', 'console_scripts', 'imposm')()
File "/usr/local/lib/python2.7/dist-packages/imposm/app.py", line 316, in main
options.table_prefix_production, options.table_prefix_backup)
File "/usr/local/lib/python2.7/dist-packages/imposm/db/postgis.py", line 320, in swap_tables
cur.execute('UPDATE geometry_columns SET f_table_name = %s WHERE f_table_name = %s', (rename_to, view_name))
psycopg2.IntegrityError: duplicate key value violates unique constraint "geometry_columns_pk"
DETAIL: Key (f_table_catalog, f_table_schema, f_table_name, f_geometry_column)=(, public, osm_old_roads, geometry) already exists.

Something to do with the osm_old_roads already being there, any tips, can I just delete something here before I run imposm again?

Thanks anyway Joris

@GeoTimber
Copy link
Author

okay

If I run
delete from geometry_columns where f_table_name LIKE 'osm_old%';

before reimporting it is all solved,

I think
imposm -U postgres -d ... --remove-backup-tables
forgets to delete the road* views

no idea where to add this to imposm itself , maybe someone wants to update imposm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant