diff --git a/lib-sql/functions/address_lookup.sql b/lib-sql/functions/address_lookup.sql index 5d2cb94d1..26ce20738 100644 --- a/lib-sql/functions/address_lookup.sql +++ b/lib-sql/functions/address_lookup.sql @@ -262,7 +262,7 @@ BEGIN -- If the place had a postcode assigned, take this one only -- into consideration when it is an area and the place does not have -- a postcode itself. - IF location.fromarea AND location.isaddress + IF location.fromarea AND location_isaddress AND (place.address is null or not place.address ? 'postcode') THEN place.postcode := null; -- remove the less exact postcode diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index a64cbfaf9..fce897bc7 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -31,7 +31,7 @@ def execute(self, query: Query, args: Any = None) -> None: """ Query execution that logs the SQL query when debugging is enabled. """ if LOG.isEnabledFor(logging.DEBUG): - LOG.debug(self.mogrify(query, args).decode('utf-8')) # type: ignore[arg-type] + LOG.debug(self.mogrify(query, args).decode('utf-8')) super().execute(query, args)