Subject Re: [firebird-support] One Generator To Rule Them All
Author Daniel Rail
Hi,

At September 6, 2003, 15:11, sugi wrote:

> Dear firebird-support list,

> For some time now, I've been thinking about means to alleviate the
> complexity caused by the use of generators (i.e. having to
> declare/implement X number of generators and before insert triggers for
> X number of different tables, I'm lazy...:).

> Now here's some crazy idea:
> What if we just use one generator for all table PKs in a database?

> It's just a surrogate key, and by doing this, we achieved
> 'enterprise-level uniqueness' (coined by scott ambler, i think) at the
> same time.

> The obvious problem is the limit of 32bit integers, which is plenty, but
> not inexhaustible. Any suggestions or comment on whether this is a good
> idea?

Actually, generators are 64-bit integers. For the primary key field
type, either use Numeric(18,0) with FB 1.0x or BIGINT with FB 1.5,
using dialect 3.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)