modify sql functions

This commit is contained in:
2024-11-11 20:20:49 +01:00
parent e5a7906cdf
commit 9af2a9408c
12 changed files with 159 additions and 59 deletions

View File

@ -1,4 +1,6 @@
CREATE OR REPLACE FUNCTION get_website_name(in_url text) RETURNS text AS $$
CREATE OR REPLACE FUNCTION public.get_website_name(in_url text) RETURNS text
LANGUAGE plpgsql IMMUTABLE STRICT
AS $$
DECLARE
website_name text;
BEGIN
@ -27,9 +29,9 @@ BEGIN
ELSIF regexp_like(in_url, 'fantia\.jp') THEN
website_name = 'Fantia';
ELSE
RAISE EXCEPTION 'Domain % is currently not supported', in_url;
RETURN NULL;
END IF;
RETURN website_name;
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
$$;