Gokulakannan Somasundaram wrote:
> Hi,
> With the implementation of deferred unique constraints, we need to go
> back to the index second time to check whether the unique check is valid.
> Say a situation occurs like this
> a) the first session doing the unique check finds out that there is a unique
> check required second time and just makes its entry and comes back
> b) the second session doing the unique check finds out that there is a
> unique check required second time and just makes its entry and comes back
>
> While they do the second check, first session will wait for the session to
> complete and vice versa. Won't this result in a deadlock? Isn't this a
> realistic scenario?
Yes, that can happen. The deadlock detector will kick in and abort one
of the sessions.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com