I am using the below code to update or overwrite the data in the postgres table.
df.to_sql(
“table”,
sqlalchemy.create_engine(‘postgresql+psycopg2://user:password@host:port/db’),
if_exists=”append”, # also “replace”
chunksize=n,
)
I am not getting any specific error but when I check the table the data is not updated in case of append, and the rows are 0 in case of replace.
I tried setting the schema which did not help.
New contributor
Vijayakumar Pattanashetti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.