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

Upsert ON CONFLICT does not respect all_tenants?: true on identity. #1709

Open
kernel-io opened this issue Jan 11, 2025 · 2 comments
Open

Upsert ON CONFLICT does not respect all_tenants?: true on identity. #1709

kernel-io opened this issue Jan 11, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@kernel-io
Copy link
Contributor

Describe the bug
generated ON CONFLICT clause still includes multitenancy attribute even when the identity has all_tenants?: true set.

To Reproduce
When you have an identity with all_tenants?: true and you go to perform an upsert (while providing a tenant) - there will be an error from Postgrex

** (Postgrex.Error) ERROR 42P10 (invalid_column_reference) there is no unique or exclusion constraint matching the ON CONFLICT specification",

Expected behavior
the generated ON CONFLICT clause will not include the multitenancy attribute if the identity has all_tenants? set to true.

@kernel-io kernel-io added bug Something isn't working needs review labels Jan 11, 2025
@zachdaniel
Copy link
Contributor

@kernel-io would it be possible to provide a failing test illustrating this behavior? I will fix it, but I'm strapped on time and that would help me get to this sooner.

@kernel-io
Copy link
Contributor Author

yup, I'll write a test over the weekend hopefully 👍🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Up Next
Development

No branches or pull requests

2 participants