> I intend to release locks on subtransaction abort, so if the update
> fails there's room for another transaction to insert the key (which I
> understand should fail?). I guess there's a different locking mechanism
> needed; I believe nested transactions will not be enough.
Except you can keep trying and trying without the outermost transaction
failing.
Chris