Another problem is that if for ANY reason the write() method is invoked on the ir_sequence object, the next number and increment on the Postgres sequence are reset to whatever is left in the ir_sequence row.

So let us assume that the starting number was 10. 50 numbers have been issued from the postgres sequence (so next number should be 60). If for any reason ir_sequence number is updated, the next number will be 10 again.

Another problem is that if for ANY reason the write() method is invoked on the ir_sequence object, the next number and increment on the Postgres sequence are reset to whatever is left in the ir_sequence row.

So let us assume that the starting number was 10. 50 numbers have been issued from the postgres sequence (so next number should be 60). If for any reason ir_sequence number is updated, the next number will be 10 again.