Postgres updateOrCreate deadlocking #3267
-
I'm seeing an odd error and am hoping someone here sees something I don't. I use updateOrCreate from Lucid in a number of places, but today one method started deadlocking on me. The select for update creates a transaction (as it should), but then the update creates another one, thus deadlocking the update query. Relevant NPM lib versions Thing's I've tried:
Both of those have failed with the same deadlock. I'm working around it for now by manually creating the update or create logic and omitting the Here is the current code I'm trying that deadlocks:
Here is the output from knex with DEBUG=knex:query turned on:
If anyone sees something I'm missing, I'd greatly appreciate any insights. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What happens if you try the same thing with Knex directly? |
Beta Was this translation helpful? Give feedback.
What happens if you try the same thing with Knex directly?