Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This file contains fixes for the issues related to postgres database.
- ### ISSUE #1: role "root" doesn't exits
- While I run the postgres docker image with this command:
- ```bash
- sudo docker run --name=tasksiner-postgres1 -e POSTGRES_USER=tasksiner -e POSTGRES_PASSWORD=tasksiner -p 5431:5432 -d postgres
- ```
- without specifying the POSTGRES_USER environment variable, I got this issue
- ```bash
- root@irti:/# createdb ss
- createdb: could not connect to database template1: FATAL: role "root" does not exist
- root@irti:/# psql
- psql: FATAL: role "root" does not exist
- ```
- ##### FIX
- I fixed the issue by providing the POSTGRES_USER environment variable
- ```bash
- sudo docker run --name=tasksiner-postgres1 -e POSTGRES_USER=tasksiner -e POSTGRES_PASSWORD=tasksiner -p 5431:5432 -e POSTGRES_USER=root -d postgres
- ```
- Now I am able to run postgres command inside the docker container
- ```
- root@070dae455732:/# createdb s
- root@070dae455732:/# psql
- psql (11.2 (Debian 11.2-1.pgdg90+1))
- Type "help" for help.
- root=#
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement