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

