-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Unnecessary UPDATE on PK col on upsert #2446
Comments
This should be a matter of removing the postgrest/src/PostgREST/Request/MutateQuery.hs Lines 20 to 28 in 3b290d5
From the EXCLUDED attributes here postgrest/src/PostgREST/Query/QueryBuilder.hs Lines 85 to 109 in 3b290d5
|
This also seems related to #1732 If we had the That would solve this issue and with this we could also stop processing the JSON in Haskell code and only do it in SQL. |
From https://gitter.im/begriffs/postgrest?at=6302565ef4d7a323de64aa37
I have found that upserting {id: 42, comment: 'foo'} into
generates this following [pseudo]query
the do
update id=excluded.id
part is causing issues for me as i wanted to disallow updating the id once inserted so i through simplewould work.
With the above permissions and set up i can do INSERT followed by UPDATE as expected, but it turns out that i am getting 403 for upsert.
I tend to think this is a bug, as there is no real reason to include the do update id=excluded.id if the id is the default constraint. Or am i missing something?
The text was updated successfully, but these errors were encountered: