I am new to the docker. I tried to start the postgres container in docker but kept receiving below error message:
PostgreSQL Database directory appears to contain a database; Skipping initialization
FATAL: could not open directory "pg_tblspc": No such file or directory
LOG: database system is shut down
The postgres part in my docker-compose.yml is as below:
postgres: image: postgres:9.6 environment: - POSTGRES_USER=airflow - POSTGRES_PASSWORD=airflow - POSTGRES_DB=airflow # Uncomment these lines to persist data on the local filesystem. - PGDATA=/var/lib/postgresql/data/pgdata volumes: - ./pgdata:/var/lib/postgresql/data/pgdata
I searched /var/lib on my machine and there is no postgresql folder existing. No sure if it was to do with the user permission.
Any suggestions would be appreciated.