1 Index: create_funcs.sql
2 ===================================================================
3 --- create_funcs.sql (revision 2829)
4 +++ create_funcs.sql (working copy)
6 round(coor[0]::numeric, 6),
7 round(coor[1]::numeric, 6)
9 + CREATE TEMPORARY TABLE tmp
11 + AS SELECT * from logg LIMIT 0;
13 curr_id = first_wayp_new();
14 IF curr_id IS NOT NULL THEN
15 RAISE NOTICE 'curr_id er ikke null: %', curr_id;
16 currpoint = (SELECT coor FROM wayp_new WHERE id = curr_id);
17 - IF (SELECT coor FROM wayp WHERE coor[0] = currpoint[0] AND coor[1] = currpoint[1]) IS NOT NULL THEN
18 + IF (SELECT coor FROM wayp WHERE coor[0] = currpoint[0] AND coor[1] = currpoint[1] LIMIT 1) IS NOT NULL THEN
19 RAISE NOTICE '% finnes allerede i wayp', currpoint;
20 INSERT INTO wayp_rej SELECT * FROM wayp_new WHERE id = curr_id;
22 RAISE NOTICE '% er ikke i wayp', currpoint;
23 INSERT INTO wayp SELECT * FROM wayp_new WHERE id = curr_id;
24 - PERFORM update_trackpoint(currpoint);
25 + RAISE NOTICE 'Før INSERT INTO tmp...';
26 + INSERT INTO tmp SELECT * FROM logg WHERE coor <-> currpoint < 0.05;
27 + RAISE NOTICE 'DELETE FROM logg...';
28 + DELETE FROM logg WHERE coor <-> currpoint < 0.05;
29 + RAISE NOTICE '...DELETE FROM logg er ferdig, count i tmp = %', (select count(*) from tmp);
31 DELETE FROM wayp_new WHERE id = curr_id;
32 -- COPY (SELECT name FROM wayp WHERE coor::varchar = currpoint::varchar)
35 - RAISE NOTICE 'currpoint er null';
36 + RAISE NOTICE 'curr_id er null';
40 + RAISE NOTICE'UPDATE tmp...';
41 + UPDATE tmp SET sted = clname(coor), dist = cldist(coor);
42 + RAISE NOTICE 'INSERT INTO logg...';
43 + INSERT INTO logg SELECT * FROM tmp;
44 + RAISE NOTICE '...ferdig.';
46 $$ LANGUAGE plpgsql; -- }}}
48 Index: create_table.sql
49 ===================================================================
50 --- create_table.sql (revision 2829)
51 +++ create_table.sql (working copy)