Unfortunately I can’t just add github_email to the conflicting target because I’d get the following error then: ** (KeyError) key :constraint not found in: %{code: :invalid_column_reference, file: "plancat.c", line: "837", message: "there is no unique or exclusion constraint matching the ON CONFLICT specification", pg_code: "42P10", routine: "infer_arbiter_indexes", severity: "ERROR", unknown: "ERROR"}
Any idea how I can leverage the upsert functionality of insert_all while having those two conflicting constraints? Thank you.
I may be misremembering but I think you can leave the conflict_target option out and it will automatically handle it based on the unique indexes available.
Thanks for checking! I am almost sure one database does not require it, so maybe that’s MySQL. It seems it is not possible to achieve what you want, as Postgres will only use one unique index at a time? So maybe you’ll need to use transactions instead of an upsert.