Subject Re: Stopping indexes see through Transactions?
Author Svein Erling
--- In, "johnsparrowuk" wrote:
> before insert trigger:
> select count(*) from mytable where pk = into :a;
> if (a > 0) then
> exception key_viol;

Since PKs are unique this should be good enough, but

if exists(select * from mytable where pk = then
exception key_viol;

works OK even if there are lots of duplicates.