osm2pgsql append Command duplicate Key Entry?? Ignore / Overwrite

Hello Everybody,

my Problem was that i cant import europe.osm.pbf (See Here: http://forum.openstreetmap.org/viewtopic.php?pid=314287))

Now i want to import them country by country with -a (Append Database)

Command: asmar@asmar-VirtualBox:~$ time osm2pgsql -a --slim -C 1500 germany.osm.pbf

Error:

Reading in file: germany.osm.pbf
Processing: Node(16780k 284.4k/s) Way(0k 0.00k/s) Relation(0 0.00/s)WARNING: Found Out of order node 345770111 (33892098,127) - this will impact the cache efficiency
Processing: Node(125950k 222.1k/s) Way(0k 0.00k/s) Relation(0 0.00/s)COPY_END for COPY planet_osm_nodes FROM STDIN;
 failed: ERROR:  duplicate key value violates unique constraint "planet_osm_nodes_pkey"
DETAIL:  Key (id)=(12953457) already exists.
CONTEXT:  COPY planet_osm_nodes, line 95411: "12953457	657179205	68153718\N"

Error occurred, cleaning up

real	9m30.087s
user	3m27.781s
sys	0m36.526s

asmar@asmar-VirtualBox:~$ 


Is there a way where you can overwrite / ignroe Duplicate Key Values?

Maybe http://wiki.openstreetmap.org/wiki/Osmconvert is an alternative tool?

The Problem there is, if the file is too big, i cant import it (See http://forum.openstreetmap.org/viewtopic.php?pid=314287 and https://trac.openstreetmap.org/ticket/4790))

Or just use -i (Tablespace index) :smiley:

But how can i combine it? If i want to use

-a (append)
-i (no index error)
-C Caching 1500 mb Ram max
-s Slim

if i just use -a -i -s (max 800 default) it does not work.

osm2pgsql -a -i -s belgium.osm.pbf → Throws Warning that -s is not activated
osm2pgsql -a -s -i belgium.osm.pbf → Usage Error
osm2pgsql -i -a -s belgium.osm.pbf → SQL Syntax error (… planet_osm_point USING BTREE (osm_id) TABLESPACE -a
osm2pgsql -i -s -a belgium.osm.pbf → Throws Warning that -s is not activated
osm2pgsql -s -i -a belgium.osm.pbf → SQL Syntax error (… planet_osm_point USING BTREE (osm_id) TABLESPACE -a
osm2pgsql -s -i -a belgium.osm.pbf → Usage Error

Why? :frowning: