DO
$$
BEGIN
IF NOT EXISTS (SELECT trigger_name FROM information_schema.triggers WHERE trigger_schema='food600' and trigger_name='tskupinyrozpatia_koniec') THEN
	CREATE TRIGGER tskupinyrozpatia_koniec
	    AFTER INSERT OR DELETE OR UPDATE 
	    ON food600.skupinyrozpatia
	    FOR EACH ROW
	    EXECUTE PROCEDURE food600.skupinyrozpatia_koniec();
END IF;
END
$$


