Subject Re: [Firebird-Architect] Generator security - from Database trigger thread
Author Lester Caine
Jim Starkey wrote:

>>>That was the point of my comment "except that we dont seem to
>>>store the increment as part of the generator definition".
>>>If the increment was part of the generator definition then
>>>the "standard" would be defined. That aspect is not feasible
>>>with the current implementation.
>>
>>It's a subject of extension. The standard allows user-defined increments
>>defined at the DDL level. We just need to extend the system tables to
>>store the extra properties. After that everybody who has USAGE privilege
>>(also to be implemented) can call NEXT VALUE and only an owner of the
>>generator can alter the current value.
>>
>>The major question is whether we should still allow full-featured
>>GEN_ID() calls (as a legacy insecure stuff) or treat any non-1 increment
>>as ALTER and hence require the developer to adjust his code to the new
>>rules.
>
> I think you need to understand why this is important other than that the
> standard requires it. Perhaps after you understand it, you will
> understand why there are alternatives, some of which may be better.
> Good design *always* starts with a clear understanding of requirements.

I have a requirement for a generator that starts at ONE each day so that
ticket numbers are sensible values during the day ( 1 to 3 or 4 hundred
as that is what the automated announcements cope with ). There *IS* a
single non-resettable generator providing the ticket_id, but given both
legacy application access and web based access to the database, a second
generator eliminated a number of contention problems and has now been
working reliably for some years. Actually there is more than one
generator since there are multiple offices all working from zero on some
sites. So while I follow a lot of the reasoning behind making
non-resettable generators *I* need an alternative for the ticket problem!

Perhaps I am looking for a different type of generator, but it DOES do
the job for me.

--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop -
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php