3 BEGIN ISOLATION LEVEL SERIALIZABLE;
5 \echo ================ Sett avstanden hjemmefra ================
7 UPDATE logg SET avst = '(60.42543,5.29959)'::point <-> coor
9 SELECT laststed FROM stat
10 WHERE lastupdate IS NOT NULL
11 ORDER BY lastupdate DESC LIMIT 1
16 \echo ================ Oppdater sted og dist ================
18 UPDATE logg SET sted = clname(coor), dist = cldist(coor)
20 SELECT laststed FROM stat
21 WHERE lastupdate IS NOT NULL
22 ORDER BY lastupdate DESC LIMIT 1
26 INSERT INTO stat (lastupdate, laststed) VALUES (
28 (SELECT max(date) FROM logg)