The initial insert sets ver = 0, and the UPDATE doesn't apply because ver wasn't yet updated in the same statement context. By using a CTE that returns id and time, and then updating based on that, we ensure the inserted values are immediately available to compute ver = id + time.