You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Since postgres 15, there's support for the
MERGE
statement, which is basically a better upsert.
Given that the extensive sqlalchemy
docs
on postgres describe
INSERT ... ON CONFLICT
in
detail
, but do not mention
MERGE
at all, it is my suspicion that this might not be supported yet, especially as postgres 15 is relatively recent.
PS. I've tried to search the issue tracker, but I couldn't find a mention of this.
Databases / Backends / Drivers targeted
Postgres
Example Use
I don't know sqlalchemy well enough to propose what the API should look like. The below is like a kid's crayon version of what things might look like.
we implement the full blown SQL MERGE construct note for note and have it work for those backends that support it; this still does not supply a cross-platform "ON CONFLICT" construct
IMO item 1 is vastly more useful and nobody really needs a SQL standard formalized version of MERGE