[OSM-dev] Osmosis and Postgresql
Joachim Zobel
jz-2008 at heute-morgen.de
Wed Jul 8 19:00:00 BST 2009
Am Dienstag, den 07.07.2009, 18:50 -0400 schrieb Jeffrey Warren:
> No, the data is not corrupt, nor are there duplicate entries. Quite a
> few current_way_nodes are not getting deleted when they cease to be
> 'current', that is, once they're only
> history and no longer part of the current planet.
Ah, I see. It's not corruption, it's just invalid data hanging around :)
How can this happen? current_way_nodes has foreign keys on current_ways
and current_nodes.
> I asked earlier about what mechanism actually deletes
> current_way_nodes if marked for deletion (i think the tag
> is 'visible=false' but i might be mistaken) but nobody seemed to know
Are you shure that visible=false means "marked for deletion".
current_way_nodes do not have any such flag, only current_ways and
current_nodes have that.
> - it seems the best route is to go through and delete those orphans,
> but I couldn't write a single SQL query to do so efficiently and
> before writing a script to do it, I realized that the rails port
> doesn't really care if they're there, or if the constraint is
> created.
Applikations do in general work without constraints. They just tend to
corrupt data. Once the data is corrupt, applications start to behave
weird.
Please note that I do not understand the ways of the API, I just started
to answer because you seemed to have a database problem (I do understand
databases). The above answer results from just applying some "database
common sense".
Maybe someone who does understand the API can answer this.
If you need an SQL statement, just state the query in english, that
should be easily doable.
Sincerely,
Joachim
More information about the dev
mailing list