[OSM-dev] Osmosis error, duplicate

Jeffrey Warren warren at mit.edu
Fri Jun 5 19:58:51 BST 2009


Thanks, I was tracing the original foreign key constraint error (reproduced
in full below) and this line caught my eye:

  Detail: Key (node_id)=(395051992) is not present in table "current_nodes".

current_nodes has no node_id column!

The constraint is created in the latest pgsql schema, here:

(apidb06-pgsql-latest.sql:2132)
--
-- TOC entry 2018 (class 2606 OID 35690)
-- Dependencies: 1579 1961 1589
-- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema:
public; Owner: osm
--

ALTER TABLE ONLY current_way_nodes
    ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id)
REFERENCES current_nodes(id);

I changed line 2139 to:

    ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (id)
REFERENCES current_nodes(id);


I'm going to run it now to see what happens.

Best,
Jeff







###############################################


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
May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.31
May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
May 26, 2009 8:59:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Jun 1, 2009 6:50:20 PM
org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager
waitForCompletion
SEVERE: Thread for task 1-read-xml-0.6 failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load
current way nodes.
at
org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:980)
at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:110)
at java.lang.Thread.run(Thread.java:637)
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"
  Detail: Key (node_id)=(395051992) is not present in table "current_nodes".
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:343)
at
org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:977)
... 2 more
Jun 1, 2009 6:50:20 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks
failed.
at
org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:85)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:30)








On Fri, Jun 5, 2009 at 1:29 PM, Joachim Zobel <jz-2008 at heute-morgen.de>wrote:

> Am Freitag, den 05.06.2009, 12:40 -0400 schrieb Jeffrey Warren:
> > and it's been running the following query for about 24 hours:
> >
> > SELECT Count(*) AS changesetCount FROM changesets WHERE id=$1
>
> Take a look on Brets pgsql-latest.sql script (after the COPYs) and add
> the index on id:
>
> ALTER TABLE ONLY changesets
>    ADD CONSTRAINT pk_changesets PRIMARY KEY (id);
>
> Sincerely,
> Joachim
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20090605/e7bafba3/attachment.html>


More information about the dev mailing list