Frank and Fabrice,
If you aren't having any luck generating a reproducible example of this
problem, you might try recompiling the backend with LOCK_DEBUG defined
in src/include/config.h --- or just dogmake cleangmake PROFILE=-DLOCK_DEBUG all
This should produce pretty voluminous quantities of info in the
postmaster's stdout/stderr log. Run the postmaster with -d2 so we
can see the related queries too, and then maybe the log will have enough
info to tell something useful the next time you see it happen.
regards, tom lane