X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a0ae4945cd60fb395e9d08a8306fb4f7201fa7d1..f7e4aa51d386bacfe6bc58073f21dabbc288c849:/nominatim/tools/check_database.py diff --git a/nominatim/tools/check_database.py b/nominatim/tools/check_database.py index 3031026b..265f8666 100644 --- a/nominatim/tools/check_database.py +++ b/nominatim/tools/check_database.py @@ -6,8 +6,8 @@ from textwrap import dedent import psycopg2 -from ..db.connection import connect -from ..errors import UsageError +from nominatim.db.connection import connect +from nominatim.errors import UsageError CHECKLIST = [] @@ -60,7 +60,7 @@ def check_database(config): """ Run a number of checks on the database and return the status. """ try: - conn = connect(config.get_libpq_dsn()) + conn = connect(config.get_libpq_dsn()).connection except UsageError as err: conn = _BadConnection(str(err)) @@ -70,7 +70,7 @@ def check_database(config): if ret == CheckState.FATAL: conn.close() return 1 - if ret != CheckState.OK: + if ret in (CheckState.FATAL, CheckState.FAIL): overall_result = 1 conn.close() @@ -84,7 +84,8 @@ def _get_indexes(conn): 'idx_placex_rank_address', 'idx_placex_parent_place_id', 'idx_placex_geometry_reverse_lookuppolygon', - 'idx_placex_geometry_reverse_placenode', + 'idx_placex_geometry_placenode', + 'idx_placex_housenumber', 'idx_osmline_parent_place_id', 'idx_osmline_parent_osm_id', 'idx_postcode_id',