I'm trying to check if a serial value has reached its upper limit. I noticed the following unpleasant behaviour.
In the sysmaster tables sysptnhdr and sysactptnhdr the currently used serial values are in three fields for the datatypes serial, serial8 and bigserial.
If my serial approaches the upper limit for integer data types, the easiest way is to change it to a serial8 or bigserial.
During the alter table, the current value from serial is now copied into the column of the new type. Unfortunately the value of serial is not reset to 0 or NULL.
This means that a value check still reports a dangerously high serial value, even though the table no longer has this data type.
Since you can have both types serial and serial8/BigSerial in a table in parallel, you must now also check the syscolumns of the affected database to suppress this message.
At least for databases with non-english locale this is even more difficult, because you cannot access directly from sysadmin or sysmaster.
My suggestion is that only the field of the data type that is used is filled with the current serial value and the others are reset to 0 or NULL.
A repro for this behaviour can be found in the support case TS002868693.
|Who would benefit from this IDEA?||All users who use the serial data type and check if they reach its upper limit to prevent production stopping when this happens.|
|Priority Justification||There is a workaround as described above, but it is quite tricky.|
|Client Name||CURSOR Software AG|
How should it work?
Only the current serial data type should be used in the tables syspthhdr and syspactptnhdr. The others should be marked as unused with 0 or NULL.
|IBM's success depends on gathering feedback from customers like yourself. Aha Ideas Portal is the third party tool through which IBM Offering Managers gather feedback from customers such as yourself.|
|IBM is a global organization with business processes, management structures, technical systems and service provider networks that cross borders. As such, the information collected through Aha Ideas Portal (Customer Name, Customer Email Address) will be stored by them in the United States, and handled only as per IBM's instructions and policies. Your data (Name and Email Address) will NOT be shared with other IBM customers.|
|In order to safeguard your information in Aha, do not leave your workstation unattended while using this application, log off after using it, and print only if necessary. If you need to make a hardcopy, remember to pick up the print-out immediately, keep it under lock, and destroy it immediately when no longer needed.|
|NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "firstname.lastname@example.org" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions|