Mercurial > gemma
view schema/updates/1201/01.fix_support_functions.sql @ 5710:37c8feeecb4d
Merged branch sr-v2 into default.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 20 Feb 2024 21:28:56 +0100 |
parents | 8fcabb6f971e |
children |
line wrap: on
line source
CREATE OR REPLACE FUNCTION isrslt(a isrs, b isrs) RETURNS boolean AS $$ BEGIN RETURN public.isrs_cmp(a, b) < 0; END; $$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION isrsle(a isrs, b isrs) RETURNS boolean AS $$ BEGIN RETURN public.isrs_cmp(a, b) <= 0; END; $$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION isrseq(a isrs, b isrs) RETURNS boolean AS $$ BEGIN RETURN public.isrs_cmp(a, b) = 0; END; $$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION isrsge(a isrs, b isrs) RETURNS boolean AS $$ BEGIN RETURN public.isrs_cmp(a, b) >= 0; END; $$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION isrsgt(a isrs, b isrs) RETURNS boolean AS $$ BEGIN RETURN public.isrs_cmp(a, b) > 0; END; $$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION isrs_diff(a isrs, b isrs) RETURNS double precision AS $$ SELECT CAST(public.isrs_cmp(a, b) AS double precision) $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE;