Subject Re: [IBO] Determine table's key value after post
Author Helen Borrie
At 11:02 PM 15/05/2005 +0200, you wrote:
>I did what you proposed but somehow, for each record inserted the
>generator increments with 2.

Did you alter the trigger to prevent the trigger from firing a second time
if the value is not null? As I wrote:

> Write the trigger in such a way that it will only fire if no value is
> passed to it, i.e.
> create trigger xx for yy active before insert
> as
> begin
> if (new.ID is null) then
> new.ID = gen_id(gen_yy, 1);
> end

If you did do this, then do you understand that trigger changes do not take
effect immediately if the trigger has been used? In Superserver, the new
version will not be available until after all connections have logged out
and the first user has logged back in.

Even then, if a transaction has been left unresolved, that accessed that
table, the trigger changes still won't "take". So logging out all
connections and stopping the server is really the only guaranteed way to
force a PSQL change with SS.

The same thing applies to stored procedures.