[OSM-dev] Osmosis and Postgresql

Jeffrey Warren warren at mit.edu
Tue Jun 23 16:09:28 BST 2009


I dropped it as well; there are many instances of data in the planet dump
which do not meet the constraint; do you know what part of the codebase does
in fact rely upon the constraints?
Jeff

On Tue, Jun 23, 2009 at 9:09 AM, Brett Henderson <brett at bretth.com> wrote:

>  Jeffrey Warren wrote:
>
> Hi, I'm compiling a very long description of a Postgres/Rails port schema
> import, though I'm writing directly to the db. I'd be happy to share/post my
> notes on the process as I managed to get around a number of undocumented
> problems.
>  I'm still not done right now (i've been pinging the list here
> occasionally) and my latest problem is that I'm getting several errors like
> the following:
>
>
>  ERROR:  insert or update on table "current_way_nodes" violates foreign
> key constraint "current_way_nodes_node_id_fkey"
>
> DETAIL:  Key (node_id)=(17704640) is not present in table "current_nodes".
>
>
>  ********** Error **********
>
>
>  ERROR: insert or update on table "current_way_nodes" violates foreign key
> constraint "current_way_nodes_node_id_fkey"
>
> SQL state: 23503
>
> Detail: Key (node_id)=(17704640) is not present in table "current_nodes".
>
>
>  These are current_way_nodes which were not deleted from the current_
> table when their matching current_nodes were deleted. I'm now trying to
> delete them manually since this only occurs where nodes are visible=false,
> but it's confusing when this causes the foreign key constraint creation to
> fail:
>
>
>  ALTER TABLE ONLY current_way_nodes
>
>     ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id)
> REFERENCES current_nodes(id);
>
>
>  Has anyone else encountered this? Is there a better way to resolve it?
>
> When testing local imports I drop that constraint from the database.  I'm
> not aware of any better ways of solving the problem.
>
> Brett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20090623/c80ca96b/attachment.html>


More information about the dev mailing list