-
Notifications
You must be signed in to change notification settings - Fork 670
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
Postgres upsert table creation #2818
Labels
bug
Something isn't working
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using upsert mode in the to_sql method for Postgres, table creation is rolled back with the following exception: "No unique or exclusion constraint matching the ON CONFLICT".
Here is a link to the Postgres docs, where it is implied that when using "ON CONFLICT" clause, there has to be a unique constraint on the fields the upsert is happening: docs
How to Reproduce
Expected behavior
A table is created with the stated on conflict columns and subsequently data is successfully upserted.
Your project
No response
Screenshots
No response
OS
Mac
Python version
3.12.3
AWS SDK for pandas version
3.7.3
Additional context
I have created a pull request with a fix.
Thanks for you work by the way, we use your sdk a lot in my company.
The text was updated successfully, but these errors were encountered: