Wednesday, May 28, 2008

Naming Generators

There is no rules to name generator, of course. Because generators does not have any relation to it's usage. When generator is being used in trigger or procedure, you can track dependencies in rdb$dependencies table.
But, during repair services for some databases, we found that generators may not have any understandable relation with table, trigger or procedure. Moreover, we couldn't compute any relation with generator and max of primary key value.

So, we decided that there must be some guides to name generators in InterBase/Firebird. For example, it can be gen_<table_name>_id. Otherwise, how else generator can be correlated with the table in this case?