X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/3742fa2929619a4c54a50d3e79e0eeadb4d6ca6f..1a64c3bfcd6f46506b7101d9943dbc297be25f10:/src/nominatim_db/tools/freeze.py diff --git a/src/nominatim_db/tools/freeze.py b/src/nominatim_db/tools/freeze.py index e6d80e1e..a308d0eb 100644 --- a/src/nominatim_db/tools/freeze.py +++ b/src/nominatim_db/tools/freeze.py @@ -10,7 +10,7 @@ Functions for removing unnecessary data from the database. from typing import Optional from pathlib import Path -from psycopg2 import sql as pysql +from psycopg import sql as pysql from ..db.connection import Connection, drop_tables, table_exists @@ -28,6 +28,7 @@ UPDATE_TABLES = [ 'wikipedia_%' ] + def drop_update_tables(conn: Connection) -> None: """ Drop all tables only necessary for updating the database from OSM replication data. @@ -49,8 +50,8 @@ def drop_flatnode_file(fpath: Optional[Path]) -> None: if fpath and fpath.exists(): fpath.unlink() + def is_frozen(conn: Connection) -> bool: """ Returns true if database is in a frozen state """ - return table_exists(conn, 'place') is False