ERROR: function make_standard_name(unknown) does not exist while installing OSM-nominatim API

1.9k Views Asked by At

I am installing nominatim on my own server using the guidence of 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

But, I am getting following error:

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...
                                                             ^

I dont know what is "make_standard_name(unknown)", how to create it to solve "ERROR: function make_standard_name(unknown) does not exist"...

Please suggest.

2

There are 2 best solutions below

2
On

I'd say that's not actually the first error you get. Try re-running the creation and sending the output to a file. Look for the FIRST error. One way to do that is to tell psql to abort after an error, which on unix/linux is:

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

On Windows I think it's:

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

Since you've already partially loaded your data this may not work well, though, as it may try to create things that already exist. You may need to run any clean/remove script the package provides, or (if possible) run it on a new clean database instead.

For testing, try creating a new blank database and trying to load the data with:

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

Note the -1 there, which tells psql to run the job in a single transaction. That's often a good idea anyway as it ensures create/load scripts always succeed or fail as a whole.

0
On

The function make_standard_name(text) is added to the database by the proceeding step in the install process: http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Import_and_index_OSM_data

If this function is missing then either that step was missed or an error occurred during that step. You will need to run it successfully before you can import the extra country name data.

You can try ./util/setup.php --create-functions to just generate the functions (rather than ./util/setup.php --all), but given the error your database is almost certainly invalid and you will have other problems if you continue.