Subject Re: [firebird-support] FB 2.1: GTT explanation
Author Tetram Corp
hi,

well, that's ok for me that the master table can't see data from others
GTT instances

the goal is only, if during the use of the GTT, a master key is changed
or deleted (for a any reason), the GTT is changed as well...
as with regular tables in fact: AFAIK, details (and master) data for
other transactions doesn't change until commit of the current transaction

it is why I understand it isn't possible that a regular table reference
a GTT (after all, how could exist details data without master data :-)
), but also why I needed informations to understand that it isn't
possible to make a GTT referencing a regular table.

Thierry

Vlad Khorsun a écrit :
>
> > So, are there some risks to make some triggers (mine) to have a
> > "reference behaviour"?
>
> It is impossible to create trigger for permanent master table which will
> see data from all GTT instances. This trigger will see only GTT instances
> which it allowed to see - from the same connection or transaction.
>
> From the other side, if you have permanent master table which PK is
> never deleted or updated then you can safely refer to such master table
> from detail tables of any kind and without need to declare FK.
>
> > (by the way, here "references" doesn't mean "dependencies", does it?)
>
> Of course. But you must always take into account scope of GTT.
>
> Regards,
> Vlad
>
>