Reputation: 71
I have encountered a problem with the serial data type in one table in my production environment. From what I´ve learned from the documentation and Google what i have encountered should be impossible.
The column is an id defined with the serial data type a unique index and a primary key constraint.
A couple of days ago it suddenly started to increment in steps of ten when a new post is inserted instead of one that is the normal behaviour for a serial. When I check in the sysactptnhdr
table for the next number in the series it is set to last inserted id + ten.
Is there anyone else that has encountered the same problem?
I have also checked my development and test environments and he error does not occure there.
Upvotes: 2
Views: 418
Reputation: 71
The problem is solved. The table was set up for replication and the replication and there was a parameter (CDR_SERIAL) in the ONCONFIG file that was set to 10, 1. This means that the serial for replicated tables will increment by ten with an offset of one, this is a solution for when you have two way replication between databases. You set up the servers with different offset to make sure that there is no conflicts between the serials in the replicated table.
Upvotes: 1