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