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

@@ -49,7 +49,7 @@ def load_address_levels(conn, table, levels):
_add_address_level_rows_from_entry(rows, entry)
with conn.cursor() as cur:
cur.execute('DROP TABLE IF EXISTS {}'.format(table))
cur.drop_table(table)
cur.execute("""CREATE TABLE {} (country_code varchar(2),
class TEXT,