Re: Deadlock possibility in _bt_check_unique? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Deadlock possibility in _bt_check_unique?
Date
Msg-id 3384.1269366595@sss.pgh.pa.us
Whole thread Raw
In response to Re: Deadlock possibility in _bt_check_unique?  (Gokulakannan Somasundaram <gokul007@gmail.com>)
Responses Re: Deadlock possibility in _bt_check_unique?
List pgsql-hackers
Gokulakannan Somasundaram <gokul007@gmail.com> writes:
> This is fine, if the second session has to pass through the page, where the
> first session inserted the record. But as i said if the second session finds
> a free slot before hitting on the page where the first session inserted,
> then it will never hit the page with write lock. The comment says that,

No, you don't understand how it works.  All would-be inserters will hit
the same target page to begin with, ie, the first one that the new key
could legally be inserted on.  The lock that protects against this
problem is the lock on that page, regardless of which page the key
actually ends up on.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gokulakannan Somasundaram
Date:
Subject: Re: Deadlock possibility in _bt_check_unique?
Next
From: Gokulakannan Somasundaram
Date:
Subject: Re: Deadlock possibility in _bt_check_unique?