Subject Re: [firebird-support] HOW TO MANAGE ROW KEYS WHEN MOVING PROJECT FROM ONE DB TO ANOTHER?
Author Alexandre Benson Smith
Dimitry Sibiryakov wrote:
>> How would one normally deal with this problem? Presumably one must always use globally unique keys, but can these be generated in firebird?
>>
>
> Three usual solutions:
>
> 1) composite Primary Key, which include unique database ID;
> 2) Ranges, as mentioned by Helen;
> 3) UUIDs, also already mentioned.
>

4) Use fixed increments (example 100) and start the generator value with
distinct values for each site, so the keys on site 1 would be 1, 101,
201, 203, 401.... on site 2 it would be 2, 102, 202, 302, ... on site 99
it would be 99, 199, 299, etc.

That way you don't need to check for overlap values, once the numbers
grow to infinite...

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br