I respect their decision to delay a bit. Looking forward to trying it out.
Especially this one:
PostgreSQL 19 adds INSERT ... ON CONFLICT DO SELECT, which lets the RETURNING clause return existing rows that conflict with an insert, simplifying the common "get or create" pattern.
I respect their decision to delay a bit. Looking forward to trying it out.
Especially this one:
PostgreSQL 19 adds INSERT ... ON CONFLICT DO SELECT, which lets the RETURNING clause return existing rows that conflict with an insert, simplifying the common "get or create" pattern.
Any idea if the select is guaranteed to "see" the conflicting record? For example, if it was deleted "between" the insert failure and the select?
Update: it looks like yes, at least for basic scenarios (https://dev.to/gabrielanhaia/your-postgres-get-or-create-has...)
The ON CONFLICT DO SELECT looks like a good addition, getting the existing row back from RETURNING. No more second SELECT after DO NOTHING.
- is the data inside postgres stored similar to this? https://www.nan.fyi/database
- this article talks about key value stores, would relational follow the same method
Nothing in those release notes refers to "key value stores"