Skip to content
Snippets Groups Projects
is_hi_pg_int8_.txt 427 B
Newer Older
  • Learn to ignore specific revisions
  • Christopher Lenke's avatar
    Christopher Lenke committed
    -- DROP FUNCTION schema_xyz.is_hi_pg(int8);
    
    CREATE OR REPLACE FUNCTION schema_xyz.is_hi_pg(my_uid bigint)
     RETURNS bigint
     LANGUAGE plpgsql
    AS $function$
    	
    
    DECLARE
    
    
    ergebnis bigint;
    
    
    BEGIN
    
    select count(*) into ergebnis
    from schema_xyz.relation where uid_1=my_uid and uid_0=0 
    and type in (0,1) ;
    
    if ergebnis >0 then ergebnis:=1;
    else ergebnis:=0;
    end if;
    
    RETURN ergebnis;
    end;
    
    $function$
    ;