Hi list,
I'm trying to import PBF data with osm2pgsql tool and I have a unique constraint violation:
COPY switzerland_nodes FROM STDIN; failed: ERROR: duplicate key value violates unique constraint "switzerland_nodes_pkey" DETAIL: Key (id)=(11399324) already exists.
The data is coming from http://download.geofabrik.de/ (switzerland-latest.osm.pbf). I ran this import several months ago and it worked fine, so I think there is an issue in current data (the issue was also present last month).
Do you know if there is a way to fix this dupplicate value issue directly in OSM data or it's related to PBF export?
Thanks for your answer.
Rémi
Hi Rémi,
I've just tried that with todays switzerland-latest.osm.pbf and the latests osm2pgsql version and it works fine. Could you please add which version of osm2pgsql you are using and the exact command line you use to import the file.
Thanks
Sarah
On Mon, Oct 03, 2016 at 09:37:25AM +0200, Rémi Bovard wrote:
Hi list,
I'm trying to import PBF data with osm2pgsql tool and I have a unique constraint violation:
COPY switzerland_nodes FROM STDIN; failed: ERROR: duplicate key value violates unique constraint "switzerland_nodes_pkey" DETAIL: Key (id)=(11399324) already exists.
The data is coming from http://download.geofabrik.de/ (switzerland-latest.osm.pbf). I ran this import several months ago and it worked fine, so I think there is an issue in current data (the issue was also present last month).
Do you know if there is a way to fix this dupplicate value issue directly in OSM data or it's related to PBF export?
Thanks for your answer.
Rémi
talk-ch mailing list talk-ch@openstreetmap.ch http://lists.openstreetmap.ch/mailman/listinfo/talk-ch
Hi Sarah,
Thank you for your answer.
Here are the infos:
* Version: osm2pgsql SVN version af61cae663 (64bit id space) * Command: osm2pgsql -s -H <host> -P <port> -U <user> -d <database> -S default.style -p switzerland switzerland-latest.osm.pbf
Rémi
Hi Rémi,
I've just tried that with todays switzerland-latest.osm.pbf and the latests osm2pgsql version and it works fine. Could you please add which version of osm2pgsql you are using and the exact command line you use to import the file.
Thanks
Sarah
On Mon, Oct 03, 2016 at 11:41:33AM +0200, Rémi Bovard wrote:
Hi Sarah,
Thank you for your answer.
Here are the infos:
- Version: osm2pgsql SVN version af61cae663 (64bit id space)
- Command: osm2pgsql -s -H <host> -P <port> -U <user> -d <database> -S
default.style -p switzerland switzerland-latest.osm.pbf
I cannot find that specific version in the official git repos, so maybe this is some hacked versoin of osm2pgsql? The command line at least looks okay, I tried with pretty much the same command.
I've also checked the pbf and it doesn't contain any duplicates, so osm2pgsql is wrong here. Maybe it isn't properly deleting the nodes table before starting the import. Normally it should drop and recreate table.
In any case, I would recommend to try with a newer version of osm2pgsql. Either the 0.90.1 release or the newest source from github.
Kind regards
Sarah
Hi Sarah,
Thanks a lot for the tip, it worked as expected.
I don't remember from where I got my version but using a more recent one made it!
Best regards,
Rémi
I cannot find that specific version in the official git repos, so maybe this is some hacked versoin of osm2pgsql? The command line at least looks okay, I tried with pretty much the same command.
I've also checked the pbf and it doesn't contain any duplicates, so osm2pgsql is wrong here. Maybe it isn't properly deleting the nodes table before starting the import. Normally it should drop and recreate table.
In any case, I would recommend to try with a newer version of osm2pgsql. Either the 0.90.1 release or the newest source from github.
Kind regards
Sarah