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

后端 未结 11 1005
醉话见心
醉话见心 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:27

    I agree about all of the above solutions. I was running Postgres on a server, and the problem was that I was using a PORT number that was used by some other OLDER version of Postgres.

    I only needed to change the port.

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

    This (https://gist.github.com/olivierlacan/e1bf5c34bc9f82e06bc0) solved my problem! I first had to:

    1. Delete Postgres.app from my Applications
    2. Delete /usr/local/var/postgres directory
    3. initdb /usr/local/var/postgres/

    Then I was able to start/stop Postgres with these 2 commands:

    Start:

    pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    

    Stop:

    pg_ctl -D /usr/local/var/postgres stop -s -m fast
    
    0 讨论(0)
  • 2020-12-13 00:30

    I had the same error psql: FATAL: could not open relation mapping file "global/pg_filenode.map": No such file or directory.

    Thanks for note #2 above: 'Kill the processes for 9.0.3'

    I previously configured and compiled PostgreSQL. I then decided to reconfigure, gmake, gmake install with different file paths. The newly compiled program wasn't finding 'pg_filenode.map' in the expected filepath. Killing the running postgres process, emptying pgsql/data, and doing initdb again allowed creation of a new database.

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

    That may be a permission issue, Please check the owner and group of configuration files in /var/lib/pgsql/9.3/data/

    chown -R postgres:postgres /var/lib/pgsql/9.3/data/
    

    solved the issue for me

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

    My step-by-step solution in fedora:

    • /bin/systemctl stop postgresql.service (Stop the service)
    • rm -rf /var/lib/pgsql/data (Remove the "data" direcotry)
    • postgresql-setup initdb (Recreate the "data" directory)
    • /bin/systemctl start postgresql.service (Start the service)

    It is also useful to check the permissions of the "data" directory:

    chown -R postgres:postgres <path_to_data_dir>

    (Kudos to @LuizFernandodaSilva & @user4640867)

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

    Encountered this problem using mdillon/postgis:9.6 Docker image. Simple sudo docker restart <container id> solved the problem.

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