You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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: