to_sql just keeps on loading ?
I have used pandas.to_sql statement to store data(200 rows X 8 columns) of csv file to postgres database but it just keeps on loading for a while, however it runs perfectly when I use if_exists='append'. I have checked everything but not able to find the issue.Can someone help ?

```
username = session['username']
user_path = os.path.join("user_data",username)
userdb = username + "DB.db"
con = sqlite3.connect(Path(user_path,userdb))
con.row_factory = sqlite3.Row
cur = con.cursor()
cur.execute("select * from data")
data = cur.fetchall()
con.close()

if request.method == 'POST':
    uploadExcel = request.files['uploadExcel']
    if uploadExcel.filename != '':
        filepath = os.path.join(
           user_path , uploadExcel.filename)
        if os.path.exists(filepath):
            flash("The file with the same name already exists !","danger")
        else:
            uploadExcel.save(filepath)
            con = sqlite3.connect(Path(user_path,userdb))
            cur = con.cursor()
            cur.execute("insert into data(exceldata)values(?)",
                        (uploadExcel.filename,))
            con.commit()
            flash("Excel Sheet Uploaded Successfully", "success")

            con = sqlite3.connect(Path(user_path,userdb))
            con.row_factory = sqlite3.Row
            cur = con.cursor()
            cur.execute("select * from data")
            data = cur.fetchall()
            for val in data:
                path = os.path.join(user_path, uploadExcel.filename)
                print(path)
                engine = sqlalchemy.create_engine("postgresql+psycopg2://postgres:falcon123@localhost:5432/SankovFAAS")
                df = pd.read_csv(path,index_col=False)
                print(df)
                df.to_sql('user_data',engine,if_exists='replace', method='multi',index=False)
                print("done")                
            con.close()

return render_template("ExcelUpload.html", data=data, username=session['username'], page_title=" Upload")
```