Subject Re: [firebird-support] Generators and integer primary key fields
Author Paul Vinkenoog
Hi Federico,

> Reading Interbase documentation I notice it says fields recieving
> generator values must be int64. I'm using integer fields now.

> Is the problem repeated values when I reach the integer limit?

The field value will wrap around to -2^31 and then climb to 0 again.
At that point, you get duplicate values (if the field definition
allows it).

> I think the integer limit is 2^(32-1) - 1 (about 2 * 10^30) right?

No, about 2 * 10^10.

> I can switch to int64, but I don't plan to run out of integers in
> 10.000 years of using the application. Should I switch?

If that estimate was based on the assumption that the integer limit is
2 * 10^30, you'll run out of numbers in 3,1536 nanoseconds :-)

But if you don't expect the number of rows to ever exceed 2 milliard
(Am.: billion), then an integer field is just fine.

Paul Vinkenoog