NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am following the steps as described in to install the nominatim osm db on my own server. I need to create some functions before doing

./utils/setup.php <my-planet-file> --load-data

So to create those functions I am running this command:

./utils/setup.php --create-functions

But, it gives me following error:

Error in query: ERROR: could not access file "/home/nominati/public_html/Nominatim/module/": Permission denied

As I can see error occurs while running the following query:

CREATE OR REPLACE FUNCTION transliteration(text) RETURNS text  AS '/home/nominati/public_html/Nominatim/module/', 'transliteration' LANGUAGE c IMMUTABLE STRICT;

I am running the commands with root user and file owner is also root. I already changed the file owner to postgres and tried but the same error is there. Please guide what to do?

asked 27 Jun '12, 07:24

Ravi%20Kotwani's gravatar image

Ravi Kotwani
accept rate: 0%

Found on postgreSQL doc:

"The user ID the PostgreSQL server runs as must be able to traverse the path to the file you intend to load. Making the file or a higher-level directory not readable and/or not executable by the postgres user is a common mistake."

If the full path is reachable, perhaps you need the 'executable' flag on the .so file as well (chmod +x)...

permanent link

answered 27 Jun '12, 10:09

Pieren's gravatar image

accept rate: 15%

I have already applied the 777 permission to module folder (Directory of .so file). And owner of file is root, I have also already tried it by changing the owner (chown) as postgres, nominatim and etc. But still facing the same problem? Is it a way I can delete this file and get new one with some easy steps?

(27 Jun '12, 10:49) Ravi Kotwani

You need to check the permissions not just of the directory, but of the directory's parent, and that directories parent, and... etc.

They all need to be accessible by which ever user you are running postgresql as.

To confirm if this is the case it maybe be helpful to switch to the postgres user and attempt to access the file using the full path. i.e.

su -l postgres ls -alh /home/user/path/path/

(27 Jun '12, 10:51) twain

Yeah, and don't forget the execution permission flag on the .so file itself. Rebuilding the .so file is not your current problem since postgreSQL is even not able to access the file.

(27 Jun '12, 10:59) Pieren

@Twain: Thanks for guiding, I just checked the owner of parent -> parent -> parent etc. and set the parent directory permission same as you told and its working fine now. Thanks.

(27 Jun '12, 12:05) Ravi Kotwani

I had the same problem. I checked all privileges and they were ok. I restarted postgres (/usr/bin/pg_ctl stop|start) and then it worked.

(06 Jan '16, 12:06) dusiema

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 Jun '12, 07:24

question was seen: 9,016 times

last updated: 06 Jan '16, 12:06

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum