Re:The Many Faces of Distinct in PostgreSQL
by paulddraper on Monday May 22, 2023 @10:12PM
(#36038987)
Then upsert based on gh_id.
I'm not saying that multiple unique identifiers is a code smell; I am claiming that an upsert is only sensibly done in the context of one constraint.
In my specific case, business logic dictates uniqueness of both columns is tied together i.e. if an incoming tuple has a value (1, 2) today, all subsequent expected tuples with `gh_id` 1 will also have `gh_node_id` of 2. What's the best practice to model this constraint?