Mercurial > gemma
annotate schema/updates/1201/01.fix_support_functions.sql @ 4837:3b0ec9b56d7c
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 08 Nov 2019 13:10:56 +0100 |
parents | 8fcabb6f971e |
children |
rev | line source |
---|---|
4431
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 CREATE OR REPLACE FUNCTION isrslt(a isrs, b isrs) RETURNS boolean |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 BEGIN |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 RETURN public.isrs_cmp(a, b) < 0; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 END; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 $$ LANGUAGE plpgsql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 IMMUTABLE PARALLEL SAFE; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 CREATE OR REPLACE FUNCTION isrsle(a isrs, b isrs) RETURNS boolean |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 BEGIN |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 RETURN public.isrs_cmp(a, b) <= 0; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 END; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 $$ LANGUAGE plpgsql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 IMMUTABLE PARALLEL SAFE; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 CREATE OR REPLACE FUNCTION isrseq(a isrs, b isrs) RETURNS boolean |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 BEGIN |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 RETURN public.isrs_cmp(a, b) = 0; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 END; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 $$ LANGUAGE plpgsql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 IMMUTABLE PARALLEL SAFE; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 CREATE OR REPLACE FUNCTION isrsge(a isrs, b isrs) RETURNS boolean |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 BEGIN |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 RETURN public.isrs_cmp(a, b) >= 0; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
29 END; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 $$ LANGUAGE plpgsql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
31 IMMUTABLE PARALLEL SAFE; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
32 |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
33 CREATE OR REPLACE FUNCTION isrsgt(a isrs, b isrs) RETURNS boolean |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
34 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
35 BEGIN |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
36 RETURN public.isrs_cmp(a, b) > 0; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
37 END; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
38 $$ LANGUAGE plpgsql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
39 IMMUTABLE PARALLEL SAFE; |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
40 |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
41 CREATE OR REPLACE FUNCTION isrs_diff(a isrs, b isrs) RETURNS double precision |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
42 AS $$ |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
43 SELECT CAST(public.isrs_cmp(a, b) AS double precision) |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
44 $$ LANGUAGE sql |
8fcabb6f971e
Fix operator support functions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
45 IMMUTABLE PARALLEL SAFE; |