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