1 Index: create_funcs.sql
2 ===================================================================
3 --- create_funcs.sql (revisjon 2216)
4 +++ create_funcs.sql (arbeidskopi)
10 +CREATE TYPE wheretype AS (
18 +DROP FUNCTION wherepos(timestamptz);
19 +CREATE OR REPLACE FUNCTION wherepos(currtime timestamptz) RETURNS wheretype AS $$
24 + currlat numeric(8, 5);
25 + currlon numeric(8, 5);
27 + currpos = findpos(currtime);
28 + currlat = currpos[1];
29 + currlon = currpos[0];
30 + currsted = clname(currpos);
31 + currdist = cldist(currpos);
32 + RETURN(currtime, currlat, currlon, currsted, currdist);
33 + -- RETURN(currtime || currlat || currlon || currplace || currdist);
38 +-- begin-base64 644 -
39 +-- H4sIABd7IEgCA11Q0WrCMBR971fch8JacLA9CGLxIatZEUocsX0SH0qNLpCm
40 +-- WRvZGH78kupMm0DC5Zx77jm5KcWowLClQPFHjlIM7yVJi82WwPcn65hq+6i+
41 +-- dJ3mDQP79LpqlP6NTX9RUrIDzX40oB2EYbDGaY4oDsAcKzJiUC2XOnGQqGo2
42 +-- aBx25L0GeWlYx2uHiuoBRosZzOMR1UqfesPZhkyMV3Di8jjOH0+Hr/5b96+H
43 +-- 6WzHvBz86IYTsmpYdG+JvX9Y3hYef9uWW+X1Ck/wbK4p7oGWy2GVA+PwVo7x
44 +-- keIWx0ettbHEZJ0EYQg5IlmJMgxKqHP/JZLgD2CFKF3xAQAA
47 -- Returnerer antall sekunder sia midnatt for en dato.
48 DROP FUNCTION secmidnight(timestamptz);
49 CREATE OR REPLACE FUNCTION secmidnight(timestamptz) RETURNS double precision