From 3c1fceb35d2ce8dc6c47beae04d16f55be9c215c Mon Sep 17 00:00:00 2001
From: Christopher Lenke <christopher.lenke@uni-bielefeld.de>
Date: Mon, 23 Sep 2024 19:21:12 +0200
Subject: [PATCH] 23.09.2024

---
 Functions/is_te_pg_int8_.txt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Functions/is_te_pg_int8_.txt

diff --git a/Functions/is_te_pg_int8_.txt b/Functions/is_te_pg_int8_.txt
new file mode 100644
index 0000000..6205d06
--- /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$
+;
-- 
GitLab