Mercurial > gemma
view schema/updates/1201/01.fix_support_functions.sql @ 5677:a57be8bfb6ea sr-v2
More suited file names.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 11 Feb 2024 09:51:21 +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;