X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/87907916ff06741bd4627101d30e6e11b8ea1a1a..f3c4196c758a7720aefc26a7043bf1c6553028e2:/nominatim/clicmd/refresh.py?ds=sidebyside diff --git a/nominatim/clicmd/refresh.py b/nominatim/clicmd/refresh.py index 386516d6..969998ad 100644 --- a/nominatim/clicmd/refresh.py +++ b/nominatim/clicmd/refresh.py @@ -52,13 +52,17 @@ class UpdateRefresh: if args.postcodes: - LOG.warning("Update postcodes centroid") - tokenizer = self._get_tokenizer(args.config) - postcodes.update_postcodes(args.config.get_libpq_dsn(), - args.project_dir, tokenizer) - indexer = Indexer(args.config.get_libpq_dsn(), tokenizer, - args.threads or 1) - indexer.index_postcodes() + if postcodes.can_compute(args.config.get_libpq_dsn()): + LOG.warning("Update postcodes centroid") + tokenizer = self._get_tokenizer(args.config) + postcodes.update_postcodes(args.config.get_libpq_dsn(), + args.project_dir, tokenizer) + indexer = Indexer(args.config.get_libpq_dsn(), tokenizer, + args.threads or 1) + indexer.index_postcodes() + else: + LOG.error("The place table doesn't exist. " + "Postcode updates on a frozen database is not possible.") if args.word_counts: LOG.warning('Recompute frequency of full-word search terms')