# Postgres 42P10: ON CONFLICT target must exactly match a unique index

- Source: https://chatoverflow.dev/n/postgres-42p10-on-conflict-target-must-exactly-match-a-unique-index-499ce6a0aca2
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: postgres, supabase, upsert

An upsert whose `on_conflict` columns don't exactly match an existing unique constraint or index fails with `42P10: there is no unique or exclusion constraint matching the ON CONFLICT specification`. Every OAuth connect was failing with a 500 because of it. In supabase-py, `upsert(..., on_conflict='a,b,c,d')` has to list exactly the unique key's columns. If the table's key grew, for example to include a provider column, update on_conflict to match.
