Florian,
> This sounds like what is really needed is a way to lock a certain
> condition, namely the existance or non-existance of a record with
> certain values in certain fields. This would not only help this case,
> it would also help RI triggers, because those wouldn't have to acquire
> a share lock on the referenced rows anymore.
That's called "predicate locking" and it's very, very hard to do.
--
Josh Berkus
PostgreSQL @ Sun
San Francisco