diff --git a/Functions/is_te_pg_int8_.txt b/Functions/is_te_pg_int8_.txt new file mode 100644 index 0000000000000000000000000000000000000000..6205d06aef3553f0d0b18d4849f42b06ffd52375 --- /dev/null +++ b/Functions/is_te_pg_int8_.txt @@ -0,0 +1,26 @@ +-- DROP FUNCTION christines_space.is_te_pg(int8); + +CREATE OR REPLACE FUNCTION christines_space.is_te_pg(my_uid bigint) + RETURNS character varying + LANGUAGE plpgsql +AS $function$ + +DECLARE + + +ergebnis bigint; + + +BEGIN + +select count(*) into STRICT ergebnis +from relation where uid_1::bigint=my_uid::bigint and uid_0::bigint>0 and type::varchar in (0,1); + +if ergebnis >0 then ergebnis:=1; +else ergebnis:=0; +end if; + +RETURN ergebnis; +end; +$function$ +;