I wrote:
> I'm toying with the idea of adding a lock manager call defined as
> "give me a list of XIDs that currently hold locks conflicting with
> lockmode X on object Y" --- but not including XIDs merely waiting
> for such a lock. Then we could get the list of XIDs currently blocking
> ExclusiveLock, and do XactLockTableWait on each one.
I've committed a patch along these lines. I also reduced the strength
of the lock we check for from ExclusiveLock to ShareLock, which seems
sufficient --- did you have a reason for selecting ExclusiveLock in the
original coding?
regards, tom lane