Subject Re: [firebird-support] Auto Increment
Author Helen Borrie
At 03:20 PM 24/05/2004 +0700, you wrote:
>If i use a primary key with autoincrement (integer), and it reaches the
>upper limit of the data types, what should i do ?

Use separate generators for separate tables if there is a chance your
series will overflow. The number for BigInt is ***huge***, nay,
astronomical. Other things will "blow" before you use up a BigInt
generator. At the very least, systems and software will support 128-bit
integers long before your great-grandchildren use up a BigInt one.

>Actually i need to design a database that will contain date/time and
>transaction data. If i date and time as PK, i'm afraid if the BIOS date
>got error, it will make some duplication data and error will appears.

Don't use timestamps as primary keys, period. Apart from the unavoidably
ephemeral nature of BIOS timestamping, the system time is read to the
nearest second and most operations are subsecond in duration. Also, all
operations within a single insert statement loop will get the same timestamp.

Apart from that, timestamps and also floating point numbers are, by nature,
unreliable as search keys so you will get unpredictable results on joins.

/heLen