Hi Jon,<br><br>I just tried your patch but now I always get the following error when doing an import:<br><br>node_changed_mark failed: ERROR:  prepared statement "node_changed_mark" does not exist<br><br>Any ideas?<br>

<br>Thanks,<br><br>Jason<br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 8:48 PM, Jason Beverage <span dir="ltr"><<a href="mailto:jasonbeverage@gmail.com">jasonbeverage@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi John,<br><br>Thanks for the patch, I will give it a test this weekend!  I think it would be a decent option on the command line if it works out well.<br><font color="#888888"><br>Jason</font><div><div></div><div class="h5">

<br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 6:38 PM, Jon Burgess <span dir="ltr"><<a href="mailto:jburgess777@googlemail.com" target="_blank">jburgess777@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>> > I'm working with osm2pgsql (latest trunk version) to import OSM into<br>



> a<br>
> > PostgreSQL/PostGIS database.  The issue I'm having is that if I use<br>
> > the --slim option I'll occasionally get an error similar to:<br>
> ><br>
> > Going over pending relations<br>
> > COPY_END for COPY osm_rels FROM STDIN;<br>
> >  failed: ERROR:  duplicate key value violates unique constraint<br>
> > "osm_rels_pkey"<br>
> > CONTEXT:  COPY osm_rels, line 1207: "284132    0    323<br>
> ><br>
> {42198453,20559277,20559273,20558263,20494565,40702583,19846737,19826462,20582455,20585..."<br>
> ><br>
> > If I don't use slim mode, it seems to always work.  Right now I'm<br>
> just<br>
> > testing with state snapshots from <a href="http://downloads.cloudmade.com/" target="_blank">http://downloads.cloudmade.com/</a>,<br>
> but<br>
> > I'd like to be able to import the whole OSM planet database and I'd<br>
> > really like to be able to use slim mode so I can do incremental<br>
> > updates and reduce the memory requirements for importing.<br>
><br>
> If I remember correctly this error occurs when you try to import two<br>
> data sets which contain some overlapping data. In your case it appears<br>
> that relation ID 284132 appears in both the data extracts. Only the<br>
> slim<br>
> mode keeps a copy of this node/way/relation data and triggers this<br>
> error.<br>
<br>
</div>You could try the attached patch to osm2pgsql. This makes it treat all<br>
new data as a modify operation which should avoid problems caused by<br>
duplicate data. Unfortunately this makes the data import process<br>
significantly slower so I won't be applying this change to the trunk<br>
code.<br>
<br>
I will think about adding this as a new command line option and try to<br>
figure out if there is something that can be done to reduce the<br>
performance penalty.<br>
<font color="#888888"><br>
        Jon<br>
<br>
<br>
<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>