-
Notifications
You must be signed in to change notification settings - Fork 108
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
Incorrect SQL query generated for PostgreSQL.upsert #300
Comments
Hm. This is really a I think I can work up a patch for this. Going to check for an empty list of updates, and if so, we'll do a tet replace of |
Oh, that won't work. We can't do a |
@parsonsmatt oh, thanks for such a quick fix 😊 |
The code in my PR will break if nothing is inserted. I'd recommend using something else |
I tried using upsert function trying to produce
INSERT INTO ... VALUES ... ON CONFLICT DO NOTHING
. I passed an empty list of updates and got:I looked at logs and noticed that the following SQL statement is generated:
As far as I understand, it is invalid because there is nothing between SET and WHERE. I think it would be more correct to produce
DO NOTHING
instead ofUPDATE SET WHERE...
in this case. Note that insertSelectWithConflictCount seems to handle this case correctly.The text was updated successfully, but these errors were encountered: