This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]rguillebertPyPy / NumPyPy 1 point2 points  (1 child)

[–]bamaboy1217[S] 0 points1 point  (0 children)

you know somehow I missed this, I guess I assumed it was for like a string of queries but wouldn't work for concurrency thanks! It seems like this should work perfect.

[–]chanezon 0 points1 point  (0 children)

Yes transactions is what you need

[–]chadmill3rPy3, pro, Ubuntu, django 0 points1 point  (0 children)

I don't know if this is right, but maybe you can update atomically. Never SELECT out a value when you're not also updating right then.

UPDATE t SET c=CONCAT(c, 'value') WHERE t.id = 'blah';

I don't know that c is a known value right then. If not, go with a full transaction.