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

