Prova questa query: update your_table set address = regexp_replace(address, '([0-9]{5})\s+([0-9]{3})', '\1\2', 'g')