mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-08 02:54:08 +00:00
Use place_exists() into can_compute() for postcodes
This commit is contained in:
@@ -9,7 +9,7 @@ from math import isfinite
|
|||||||
|
|
||||||
from psycopg2.extras import execute_values
|
from psycopg2.extras import execute_values
|
||||||
|
|
||||||
from nominatim.db.connection import connect
|
from nominatim.db.connection import _Connection, connect
|
||||||
|
|
||||||
LOG = logging.getLogger()
|
LOG = logging.getLogger()
|
||||||
|
|
||||||
@@ -203,9 +203,5 @@ def can_compute(dsn):
|
|||||||
Check that the place table exists so that
|
Check that the place table exists so that
|
||||||
postcodes can be computed.
|
postcodes can be computed.
|
||||||
"""
|
"""
|
||||||
with connect(dsn) as conn:
|
with _Connection(dsn) as conn:
|
||||||
with conn.cursor() as cur:
|
return conn.table_exists('place')
|
||||||
cur.execute("""
|
|
||||||
select exists(select 1 from information_schema.tables where table_name='place')
|
|
||||||
""")
|
|
||||||
return cur.fetchone()[0]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user