In the sqlalchemy clinet, when I try to replace or append a pandas dataframe to a table, if it exists, I get the error of the table already existing.
When I append I get this error:
ProgrammingError: (psycopg2.errors.DuplicateTable)
When I replace I get this error:
ProgrammingError: (psycopg2.errors.DuplicateTable)
The code is similar to: (both df's are in same format, and have same columns)
dataframe_to_table(df, table="my_table")
dataframe_to_table(df2, table="my_table", if_exists="replace") # or if_exists="append"
The only solution I have had to work around this is to query the table, concatenate with the new dataframe, drop my table and then recreate it with just using the dataframe_to_table method
Is this method broken?