I have to create a spatial PostgreSQL database with Docker ans I have the following problem :
System : macOS Catalina, version 10.15.7
docker v.20.10
Python v.3.7.7
postgreSQL v.13.1 install with Brew
I enter this in my terminal to create a PostgreSQL server listening on the 5432 port with docker.
docker run --name=postgis -d -e POSTGRES_PASS=123456789 -p 5432:5432 kartoza/postgis:9.6-2.4`
Then:
`docker exec -it postgis bash`
it contained the following elements : https://i.stack.imgur.com/2VabD.png
Then I tried to access the database :
psql -U postgres
I've got this message : psql: FATAL: Peer authentication failed for user "postgres"
When I inspect the logs in docker I see this :
postgres@postgres DETAIL: Connection matched pg_hba.conf line 85: "local all postgres peer"
I open the pg_hba.conf with Sublime Text in usr/local/var/postgres/pg_hba_conf
But all methods were TRUST and line 85 was different. I still modified by putting md5 everywhere. Then I did the following command:
brew services restart postgresql
I repeated but always the same error message and the same sentence when inspecting the logs.
It seems that my postgreSQL uses another file than the pg_hba.conf I see, yet I can't find anything else.
thanks in advance