On Fri, 7 Jun 2024 at 20:35, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> The main question: is the "deadlock detected" error (1) correct?
> (I.e. is it necessary to look for the reason for this behavior?)
Looks like a fairly standard lock upgrade problem to me.
s1: create table t ();
s1: begin;
s2: begin;
s1: lock table t in access share mode;
s2: lock table t in access share mode;
s1: lock table t in access exclusive mode;
s2: lock table t in access exclusive mode; -- deadlock
Isn't this more or less the same as what's going on in your scenario?
David