3 ms·
Here's an UPSERT in postgresql: https://gist.github.com/paul/855efdecaaa2ec4deec7 https://gist.github.com/paul/855efdecaaa2ec4deec7 While we're at it, here's a
by psadauskas 13y ago
Here's an UPSERT in postgresql: https://gist.github.com/paul/855efdecaaa2ec4deec7 https://gist.github.com/paul/855efdecaaa2ec4deec7
While we're at it, here's a "find or create" in a single atomic statement: https://gist.github.com/paul/75ec84d131e36492b17b https://gist.github.com/paul/75ec84d131e36492b17b
- ocharles 13y agoI believe both of these still have race conditions, and are not the same as truly atomic upserts. Granted the window is considerably smaller, but their is still a race condition.