postgrest-js icon indicating copy to clipboard operation
postgrest-js copied to clipboard

Upserts do not seem to work on partial index on postgres

Open steve-chavez opened this issue 2 years ago • 4 comments

Discussed in https://github.com/supabase/supabase/discussions/12565

Originally posted by beacoding February 20, 2023 Looks like we cannot specify an onConflict and where together when we set a partial index on our postgres db.

We end up getting a unique or exclusion constraint matching the ON CONFLICT when a partial index is used and we specify the key to use it for.

The solution to fix this is to filter on the index_predicate, but the client does not allow us to do this https://stackoverflow.com/questions/42022362/no-unique-or-exclusion-constraint-matching-the-on-conflict

Are there any plans to support upserts of partial indices?

steve-chavez avatar Feb 21 '23 17:02 steve-chavez

hi hi any updates on this?

beagreenlite avatar May 30 '24 22:05 beagreenlite

Same issue on my side

bragagia avatar Jun 11 '24 14:06 bragagia

Same issue, any update ?

lxup avatar Jul 28 '24 18:07 lxup

I'd love to see this. In the meantime, does anyone have any workarounds?

amerryma avatar Aug 01 '24 06:08 amerryma