Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. This file contains fixes for the issues related to postgres database.
  2.  
  3. ### ISSUE #1: role "root" doesn't exits
  4.  
  5. While I run the postgres docker image with this command:
  6.  
  7. ```bash
  8. sudo docker run --name=tasksiner-postgres1 -e POSTGRES_USER=tasksiner -e POSTGRES_PASSWORD=tasksiner -p 5431:5432 -d postgres
  9. ```
  10. without specifying the POSTGRES_USER environment variable, I got this issue
  11.  
  12. ```bash
  13. root@irti:/# createdb ss
  14. createdb: could not connect to database template1: FATAL: role "root" does not exist
  15. root@irti:/# psql
  16. psql: FATAL: role "root" does not exist
  17. ```
  18.  
  19. ##### FIX
  20. I fixed the issue by providing the POSTGRES_USER environment variable
  21.  
  22. ```bash
  23. sudo docker run --name=tasksiner-postgres1 -e POSTGRES_USER=tasksiner -e POSTGRES_PASSWORD=tasksiner -p 5431:5432 -e POSTGRES_USER=root -d postgres
  24. ```
  25.  
  26. Now I am able to run postgres command inside the docker container
  27.  
  28. ```
  29. root@070dae455732:/# createdb s
  30. root@070dae455732:/# psql
  31. psql (11.2 (Debian 11.2-1.pgdg90+1))
  32. Type "help" for help.
  33.  
  34. root=#
  35.  
  36. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement