0

I recently ran a Postgres via Docker where in I have a Dockerfile that copies an init script to add new user, enable UUID extension, created database and grant privileges.

I can login using the default user "postgres" but not the second account "XXX_itsm". It says FATAL: database "XXX_itsm" does not exist. What I'm planning to do is just create a database but another problem occurred when connecting via GUI (Postico / TablePlus).

enter image description here

Which leads me to the following questions:

  1. What is the proper way of creating a user? (I have this current init script in entrypoint) enter image description here NOTE: I have the variables defined in Dockerfile ENV DB_USER DB_PASS DB_NAME

  2. Why it's only allowing me to login in GUI with the default user?

Rye
  • 445
  • 4
  • 15
  • For the password problem, what does the servers log file give for the error? – jjanes Dec 13 '20 at 13:57
  • It says `DETAIL: Password does not match for user "XXX_itsm". Connection matched pg_hba.conf line 99: "host all all all md5"`. At the moment, I'm not sure why but `psql` command to login is ok. – Rye Dec 14 '20 at 01:31
  • Are you absolutely sure you type in the same password for both programs? Are there any weird characters that Postico might not like in it? – jjanes Dec 14 '20 at 03:13
  • Yes @jjames, I am sure I've typed the exact working password in Postico. This is really weird. I already recreated the images, volume, container multiple times. – Rye Dec 14 '20 at 03:32
  • At the moment tried to use alphanumeric password and it's working. Previously I have special characters `_ ! $ @`. After further checking, the `@` is causing the issue when logging in via GUI so I had to removed it and now it works. Maybe this is a bug with Postico / TablePlus (I don't know). – Rye Dec 14 '20 at 03:43
  • Yeah, that does sound like a bug. – jjanes Dec 14 '20 at 04:23

0 Answers0