Hi,
does the numbers have to be within a specific range? If not then you could do a calculation including the rowid of the table. The rowid is an implicit column in every table and actually the primary index, therefore it's unique for every row in the table. So
Code:
SELECT substr(transnumber, 4, 4)::INTEGER + rowid ...
shall give a unique number if the results of the subtring function are equal.
Regards,
Hans