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.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a postgres table like this:
I would like to insert or update a number of rows which are either:
id
is the same, butname
anddescription
are new)id
andname
are the same, butdescription
is new)I've attempted to do this through:
But I end up with
error: duplicate key value violates unique constraint "table_name_unique"
.Is there a way to perform an upsert which satisfies all three scenarios?
Beta Was this translation helpful? Give feedback.
All reactions