Postgres is failing with 'could not open relation mapping file “global/pg_filenode.map” '

后端 未结 11 1006
醉话见心
醉话见心 2020-12-12 23:49

I\'m having an issue with my install of postgres in my development environment and I need some help diagnosing it. I haven\'t yet had any luck in tracking down a solution.

相关标签:
11条回答
  • 2020-12-13 00:33

    My solution to this problem:
    I am running postgresql-9.3

    My plist file is in the following directory:/Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist

    Step 1 will stop postgres
    1. $ sudo launchctl stop com.edb.launchd.postgresql-9.3
    Start postgres using the following command (can find this location using $ brew info postgres)
    2. $ postgres -D /usr/local/var/postgres

    0 讨论(0)
  • 2020-12-13 00:34

    I had an old value of PGDATA confusing things.

    0 讨论(0)
  • 2020-12-13 00:35

    I am not sure what the source of my original problem was with 9.0.3 because I was getting this problem:

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

    However as stated above it turns out that the running process was for my previous postgres install of 9.0.3

    I believe I had an old version org.postgresql.postgres.plist in ~/Library/LaunchAgents/

    I had to:

    1. Remove and re-add the launch agent
    2. Kill the processes for 9.0.3
    3. Initialize the db initdb /usr/local/var/postgres
    4. Restart my computer

    and now I have it up and working.

    0 讨论(0)
  • 2020-12-13 00:35

    ps aux | grep postgres revealed I had another instance of postgres running on a temp data directory from a previous test run. Killing this process fixed the problem.

    0 讨论(0)
  • 2020-12-13 00:37

    I just encountered this problem. Solved it by setting the owner of the postgres data directory to the unprivileged postgres user.

    0 讨论(0)
提交回复
热议问题