Deadlock detected when inserting multiple (Postgrex.Error 40P01)

Thanks kip. Yes, I believe this is Phoenix’s default, but I rechecked just in case. I also run into a unique index constraint error with another test but that’s rarer, I’d say 5% of the time, while deadlock is 10%.

Not a dealbreaker by any stretch of the imagination, and if it gets too annoying I can simply set async to false.

If you think there could be something wrong or missing with the way my Ecto.Multi is set up, please let me know, I’m new to Elixir and Phoenix and am keen to dive deeper.

Thanks again :slight_smile: