mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
use psycopg's SQL quoting where possible
Use the SQL formatting supplied with psycopg whenever the query needs to be put together from snippets.
This commit is contained in:
@@ -58,7 +58,7 @@ def load_address_levels(conn, table, levels):
|
||||
rank_address SMALLINT)""".format(table))
|
||||
|
||||
cur.execute_values(pysql.SQL("INSERT INTO {} VALUES %s")
|
||||
.format(pysql.Identifier(table)), rows)
|
||||
.format(pysql.Identifier(table)), rows)
|
||||
|
||||
cur.execute('CREATE UNIQUE INDEX ON {} (country_code, class, type)'.format(table))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user