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 ?
2 Answers 2
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.
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.
initdb?