Open sblackstone opened 1 year ago
Additionally, the fall-back behavior when an on-conflict clause exists but doesn't match the primary keys was super-confusing and I'd suggest that it should return an error rather than just doing an insert.
Any good news on this issue?
Would be nice to have @jhajjaarap's patch upstreamed! :tada:
@jhajjaarap Perhaps create a pull request for upstreaming your fix? Would love to get that merged.
Describe the feature
Merge (upsert) queries currently require all of the columns in
clause.Conflict.Columns
to be primary keys, otherwise it silently falls back to a regular insert.A table can have a primary key thats simply an auto-increment referencing the row, but also unique constraints which can trigger the
ON CONFLICT
case of a merge query.Motivation
Upsert queries that aren't necessarily looking at the primary key.
Related Issues
None.