2

I installed postgress.app on mac os when I try to connect to console : psql -h localhost I got this problem .

psql -h localhost psql: FATAL: could not open relation mapping file "global/pg_filenode.map": No such file or directory

Any ideas how to solve this ?

5
  • Did you run initdb?
    – user1822
    Jan 19, 2014 at 9:22
  • Yes I did. I am trying now to re-install everything. Jan 19, 2014 at 9:34
  • If the datadir exists, then it's probably a file permission problem. The user running the postgres service probably does not have the rights to access the files (or is looking in the wrong place)
    – user1822
    Jan 19, 2014 at 9:35
  • what do you suggest to do ? Jan 19, 2014 at 9:35
  • Is there data you care about on that database instance? If so read and act on the guidance for database corruption. Jan 20, 2014 at 2:11

2 Answers 2

1

I had the same error when I tried to reinstall PostgreSQL on RHEL6 using a Chef cookbook. In my case this seems to have been due to an incorrect manual uninstallation of PostgreSQL. I used this command to find the offending files that disrupted my installation:

find / -user postgres  

And then I deleted all the files I found as they were owned by postgres and I did not even have a postgres user. To be on the safe side I also rebooted the machine and after that it worked like a charm.

0

In my case this was caused by a running postgresql and me running initdb a few times. Killing all postgresql processes, removing the pgsql/data directory, running initdb and then starting postgresql again solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.