provide wrapper function for DROP TABLE

Use psycopg2 formatting to ensure correct quoting.
This commit is contained in:
Sarah Hoffmann
2021-07-12 20:32:46 +02:00
parent cf98cff2a1
commit 06602b4ec0
5 changed files with 26 additions and 16 deletions

View File

@@ -29,7 +29,7 @@ def drop_update_tables(conn):
tables = [r[0] for r in cur]
for table in tables:
cur.execute('DROP TABLE IF EXISTS "{}" CASCADE'.format(table))
cur.drop_table(table, cascade=True)
conn.commit()