CREATE OR REPLACE FUNCTION public.tr_raktar_mozgas_fej_rogz()
  RETURNS trigger AS
$BODY$
declare
   rsult boolean;
begin
   if ((new.bizonylat_fajta = 11) and (new.sztornozo_bizonylat_kod > 0)) then
      SELECT rendeles_frissit(tetel_kod) INTO rsult FROM raktar_mozgas WHERE raktar_mozgas.fej_kod = new.kod;
   end if;

  return new;
end;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;