Reputation: 1
Will the following case work correctly? I open a transaction on the backend, do an update, check how many rows have been changed, and if no rows have been changed, I do an insert, then commit the transaction. I can't use unique index and "insert ... on conflict do update" due to business logic. There can be several requests with the same parameters at the same time. Wouldn't there be multiple inserts in this case?
transaction isolation level - read committed
I expect only one insert will always be done and all updates will be done correctly.
Upvotes: 0
Views: 631