Gokulakannan Somasundaram <gokul007(at)gmail(dot)com> writes:
> I am really confused. Please keep the cool and explain me, if i am
> wrong. I could see this code in _bt_findinsertloc. There is a
> _bt_relandgetbuf, which releases lock on p1 and tries to acquire a lock on
> p2.
No, read it again. The only locks that get released inside that loop
are ones on intermediate dead pages (rbuf is not buf). The lock on the
original page is only released after the loop.
regards, tom lane