X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9659afbade47d1ec6d5359b2b21e1e874516ed80..f0390cfe85c27f74f07972541f23cd2d9ef6435d:/src/nominatim_db/clicmd/add_data.py diff --git a/src/nominatim_db/clicmd/add_data.py b/src/nominatim_db/clicmd/add_data.py index a690435c..e2058b74 100644 --- a/src/nominatim_db/clicmd/add_data.py +++ b/src/nominatim_db/clicmd/add_data.py @@ -15,6 +15,8 @@ import asyncio import psutil from .args import NominatimArgs +from ..db.connection import connect +from ..tools.freeze import is_frozen # Do not repeat documentation of subcommand classes. # pylint: disable=C0111 @@ -36,7 +38,7 @@ class UpdateAddData: The command can also be used to add external non-OSM data to the database. At the moment the only supported format is TIGER housenumber data. See the online documentation at - https://nominatim.org/release-docs/latest/admin/Import/#installing-tiger-housenumber-data-for-the-us + https://nominatim.org/release-docs/latest/customize/Tiger/ for more information. """ @@ -67,6 +69,11 @@ class UpdateAddData: def run(self, args: NominatimArgs) -> int: from ..tools import add_osm_data + with connect(args.config.get_libpq_dsn()) as conn: + if is_frozen(conn): + print('Database is marked frozen. New data can\'t be added.') + return 1 + if args.tiger_data: return asyncio.run(self._add_tiger_data(args))