xxxxxxxxxx
create or replace function update_points()
returns trigger as
$BODY$
begin
if EXISTS (select 1 FROM vereine WHERE team = new.team ) then
update vereine
set punkte = new.punkte
where team = new.team;
RETURN NULL;
else
RETURN NEW;
end if;
end;
$BODY$
LANGUAGE plpgsql;