In case someone is running the pgadmin-4 in docker, and not able to connect to postgres container, like me.
The solution is to first find the ip at which the docker image is running.
Step-1, make sure the postgres container is running.
Step-2 write command- PS C:\docker> docker ps
Should result as below or similar,

Step3- in order to find the ip address running the postgres use part of container ID and analyze like below command
PS C:\docker> docker inspect fc834

Note: Here I have only used part of container id that is fc834..
This should result the following or similar,
Step4-
Use this ip address in the connection as below with your correct username and password

