English 中文(简体)
ERROR: 安装 OSM- nominatim API 时, 函数 make_ standard_ name( 未知) 不存在
原标题:ERROR: function make_standard_name(unknown) does not exist while installing OSM-nominatim API

我用http://wiki.openstreetmap.org/wiki/Nominatim/Installation 的指南在自己的服务器上安装名词。

But I am facing problem while adding country phrases / codes to my pgsql DB. I am doing this with following command as given in above link:

psql -d nominatim -f specialphrases_countries.sql

但是,我正在追踪错误:

psql:specialphrases_countries.sql:1: ERROR:  function make_standard_name(unknown) does not exist
LINE 1: select getorcreate_country(make_standard_name( uk ),  gb );
                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:specialphrases_countries.sql:2: ERROR:  function make_standard_name(unknown) does not exist
LINE 1: select getorcreate_country(make_standard_name( united states...
                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:specialphrases_countries.sql:3: ERROR:  relation "country_name" does not exist
LINE 1: ...e_standard_name(country_code), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:4: ERROR:  relation "country_name" does not exist
LINE 1: ...try_name.name,ARRAY[ name ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:5: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:af ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:6: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ar ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:7: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:br ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:8: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ca ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:9: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:cs ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:10: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:de ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:11: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:en ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:12: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:es ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:13: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:et ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:14: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:eu ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:15: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:fa ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:16: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:fi ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:17: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:fr ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:18: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:gl ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:19: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:hr ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:20: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:hu ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:21: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ia ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:22: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:is ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:23: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:it ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:24: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ja ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:25: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:mk ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:26: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:nl ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:27: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:no ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:28: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:pl ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:29: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ps ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:30: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:pt ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:31: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:ru ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:32: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:sk ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:33: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:sv ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:34: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:uk ])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:35: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY[ name:vi ])), country_code) from country_na...
                                                             ^

我不知道什么是"Make_stand_name(未知)", 如何创建它来解决“ERROR:函数 make_stand_name(未知)不存在”...

请建议。

问题回答

安装过程中按程序步骤将函数 make_stand_name(text) 添加到数据库中: http://wiki.openstreetmap.org/wiki/Nominatim/Installation#import_and_index_OSM_data

3⁄4 ̄ ̧漯B

您可以尝试 ./ util/ setup.php > 来生成函数( 而不是 ./ util/ setup.php -- all ), 但鉴于错误, 您的数据库几乎肯定无效, 如果您继续的话, 您将会遇到其他问题 。

我说这实际上不是第一个错误。 尝试重新运行创建程序并将输出发送到文件。 查找第一个错误。 一种方法就是告诉 psql 在错误发生后中止, 在 unix/ linux 上是 :

ON_ERROR_STOP=1 psql -d nominatim -f specialphrases_countries.sql

在Windows上我想是这样的:

set ON_ERROR_STOP=1
psql -d nominatim -f specialphrases_countries.sql

既然您已经部分装入了您的数据, 这可能不会成功, 因为它可能试图创建已经存在的东西 。 您可能需要运行软件包所提供的任何干净/ 删除脚本, 或者( 如果可能的话) 在新的干净数据库中运行 。

测试时, 尝试创建一个新的空白数据库, 并尝试将数据装入 :

ON_ERROR_STOP=1 psql -d mytestdb -1 -f specialphrases_countries.sql

请注意那里 -1, 它告诉 psql 在一个交易中运行该任务。 这通常是一个好主意, 因为它确保创建/ 装入脚本总是成功或整个失败 。





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...