title: How do I insert a pandas DataFrame to an existing PostgreSQL table?
body: <p>I have a pandas DataFrame <code>df</code> and a PostgreSQL table <code>my_table</code>. I wish to truncate <code>my_table</code> and insert <code>df</code> (which has columns in the same order) into <code>my_table</code>, without affecting the schema of <code>my_table</code>. How do I do this?</p>
  
  <p>In a rather naive attempt, I tried dropping <code>my_table</code> and then using <code>pandas.DataFrame.to_sql</code>, but this creates a new table with a different schema.</p>