<div>Thanks, I was tracing the original foreign key constraint error (reproduced in full below) and this line caught my eye:</div><div><br></div><div><div>  Detail: Key (node_id)=(395051992) is not present in table "current_nodes".</div>
<div><br></div><div>current_nodes has no node_id column!</div><div><br></div><div><div>The constraint is created in the latest pgsql schema, here:</div><div><br></div><div>(apidb06-pgsql-latest.sql:2132)</div><div>--</div>
<div><div>-- TOC entry 2018 (class 2606 OID 35690)</div><div>-- Dependencies: 1579 1961 1589</div><div>-- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: osm</div><div>--</div><div><br></div>
<div>ALTER TABLE ONLY current_way_nodes</div><div>    ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);</div><div><br></div></div><div>I changed line 2139 to:</div><div><br>
</div><div><div>    ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (id) REFERENCES current_nodes(id);</div><div><br></div><div><br></div><div>I'm going to run it now to see what happens.</div><div><br></div>
<div>Best,</div><div>Jeff</div><div><br></div><div><br></div><div><br></div></div><div><br></div></div></div><div><br></div><div><br></div><div><br></div><div>###############################################</div><div><br>
</div><div><br></div><div><div>motel:bin eco$ cd ../motel:osmosis-0.31 eco$ bin/osmosis --read-xml-0.6 file="/Volumes/Planet/planet.osm" --write-apidb-0.6 populateCurrentTables=yes host="localhost" database="osm-planet" user="eco" password="poopies" validateSchemaVersion=no</div>
<div>May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run</div><div>INFO: Osmosis Version 0.31</div><div>May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run</div><div>INFO: Preparing pipeline.</div>
<div>May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run</div><div>INFO: Launching pipeline execution.</div><div>May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run</div><div>INFO: Pipeline executing, waiting for completion.</div>
<div>Jun 1, 2009 6:50:20 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion</div><div>SEVERE: Thread for task 1-read-xml-0.6 failed</div><div>org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load current way nodes.</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:980)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:110)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at java.lang.Thread.run(Thread.java:637)</div><div>Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "current_way_nodes" violates foreign key constraint "current_way_nodes_node_id_fkey"</div>
<div>  Detail: Key (node_id)=(395051992) is not present in table "current_nodes".</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:343)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:977)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>... 2 more</div><div>Jun 1, 2009 6:50:20 PM org.openstreetmap.osmosis.core.Osmosis main</div><div>SEVERE: Execution aborted.</div><div>org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:85)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:30)</div><div><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
<br></div><br><br><div class="gmail_quote">On Fri, Jun 5, 2009 at 1:29 PM, Joachim Zobel <span dir="ltr"><<a href="mailto:jz-2008@heute-morgen.de">jz-2008@heute-morgen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Am Freitag, den 05.06.2009, 12:40 -0400 schrieb Jeffrey Warren:<br>
<div class="im">> and it's been running the following query for about 24 hours:<br>
><br>
> SELECT Count(*) AS changesetCount FROM changesets WHERE id=$1<br>
<br>
</div>Take a look on Brets pgsql-latest.sql script (after the COPYs) and add<br>
the index on id:<br>
<br>
ALTER TABLE ONLY changesets<br>
    ADD CONSTRAINT pk_changesets PRIMARY KEY (id);<br>
<br>
Sincerely,<br>
<font color="#888888">Joachim<br>
<br>
<br>
<br>
</font></blockquote></div><br>