I am a newbie with postgresql and sql statements so maybe it is a trivial question, I'm sorry for that.
I am working on a postgis database and try to use the pgrouting function. My goal is to store the results of the shortest path query in a different table than the original one, which is working so far. The problem is, that it keeps adding the results to the original table too, so there are duplicate values in it afterwards, which I try to avoid but without success so far. I don't know if it should be like this? Anyway can you suggest any solutions to this problem? (I solved it so far so that I delete the duplicate values afterwards, but I really want my database to stay unedited... is it even possible?)
I am using postgresql 8.4 with postgis 1.5 and pgrouting 1.05
This is my query:
INSERT INTO route ( SELECT topo.id, topo.osm_id, topo.osm_name, topo.osm_source_id, topo.osm_target_id, topo.clazz, topo.flags, topo.source, topo.target, topo.km, topo.kmh, topo.cost, topo.reverse_cost, topo.x1, topo.y1, topo.x2, topo.y2, topo.geom_way, topo.available FROM Shortest_path('select * from testro_2po_4pgr', 2345, 9234, false, true) AS path, testro_2po_4pgr AS topo WHERE path.edge_id=topo.id);
Thank you very much in advance!