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?<div><br></div><div>Jeff<br><br><div class="gmail_quote">
On Tue, Jun 23, 2009 at 9:09 AM, Brett Henderson <span dir="ltr"><<a href="mailto:brett@bretth.com">brett@bretth.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000"><div class="im">
Jeffrey Warren wrote:
<blockquote type="cite">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.
<div><br>
</div>
<div>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:</div>
<div>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><br>
</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">ERROR:
insert or update on table "current_way_nodes" violates foreign key
constraint "current_way_nodes_node_id_fkey"</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">DETAIL:
Key (node_id)=(17704640) is not present in table "current_nodes".</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><br>
</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">**********
Error **********</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><br>
</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">ERROR:
insert or update on table "current_way_nodes" violates foreign key
constraint "current_way_nodes_node_id_fkey"</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">SQL
state: 23503</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal">Detail:
Key (node_id)=(17704640) is not present in table "current_nodes".</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><font face="arial"><span style="font-size:small"><br>
</span></font></p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><font face="arial"><span style="font-size:small">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:</span></font></p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><font face="arial"><span style="font-size:small"><br>
</span></font></p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><font face="arial"><span style="font-size:small"><span style="font-family:'Lucida Grande';font-size:13px">ALTER TABLE
ONLY current_way_nodes</span></span></font></p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px">
ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id)
REFERENCES current_nodes(id);</p>
<p style="margin:0px;font-family:Lucida Grande;font-style:normal;font-variant:normal;font-weight:normal;font-size:13px;line-height:normal;font-size-adjust:none;font-stretch:normal;min-height:16px"><font face="arial"><span style="font-size:small"><br>
</span></font></p>
<div>Has anyone else encountered this? Is there a better way to
resolve it?</div>
</div>
</blockquote></div>
When testing local imports I drop that constraint from the database.
I'm not aware of any better ways of solving the problem.<br>
<br>
Brett<br>
<br>
</div>
</blockquote></div><br></div>