"Peter Ajamian" <peter@pajamian.dhs.org> writes:
> From what I can understand, the UPDATE is trying to lock the index before
> locking the table.
That is not the case, as study of the source code will prove to you.
I think what probably happened here is that the UPDATE was part of
a transaction that already had some relevant locks, but you haven't
provided enough information to diagnose it beyond that.
regards, tom lane