Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upserts do not seem to work on partial index on postgres #403

Open
steve-chavez opened this issue Feb 21, 2023 · 2 comments
Open

Upserts do not seem to work on partial index on postgres #403

steve-chavez opened this issue Feb 21, 2023 · 2 comments
Labels
enhancement New feature or request postgrest-patch-needed Requires a change on PostgREST

Comments

@steve-chavez
Copy link
Member

Discussed in supabase/supabase#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 steve-chavez added enhancement New feature or request postgrest-patch-needed Requires a change on PostgREST labels Feb 21, 2023
@beagreenlite
Copy link

hi hi any updates on this?

@bragagia
Copy link

Same issue on my side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request postgrest-patch-needed Requires a change on PostgREST
Projects
None yet
Development

No branches or pull requests

3 participants