Trouble connecting to PostgreSQL container through pgAdmin - postgresql

I am currently working on a school project and I need to connect to a PostgreSQL container through pgAdmin. I have used docker-compose to create the container instance of PostgreSQL and PostGIS.
But when I try to connect to my PostgreSQL container, it does not work. Maybe I have entered the details wrongly? I have attached a screenshot here of the docker-compose.yml file and the parameters that I have filled in on my pgAdmin Desktop.
What am I doing wrong?
netstat-output
Can anyone please help me? Would really appreciate it !!

Your db container's outside port is 54320, not 5432. You are trying to connect postgis container instead of postgres. And your passwords are different from each other.
You can do one of the below;
If you still want to connect to postgis, you can use password accordingly.
If you want to connect to postgres, change port to 54320 in pgAdmin.

Related

Why I see different data between postgres DB running in docker and postico from main host?

I am using docker container for postgres database, from UI which is powered from postgres. I deleted an entry from postgres via postico(client for postgres in mac), now when I see my database in postico is completely empty but when I refresh the UI, I still see the data!!!
Please correct me If I am postico is just the UI to see what is in the postgres running in the container, In that case I expected UI also to be empty but it is not the case.
Can someone tell me why my expectation is going wrong and please let me know if any info is needed?

How do I connect to the Divio postgres database with local PgAdmin?

I am trying to connect with PgAdmin to the local Divio database in the container but PgAdmin 4 will not let me connect without a password. The Divio Postgres database seems to come without a password.
Has anyone got round this?
You don't need a password.
See Interact with the local database from your host environment in the official documentation.
The key things are:
expose the database’s port by editing the docker-compose.yml file
use the correct credentials
Both steps are described in more detail in the documentation. I haven't given more specific details here such as port numbers in case those details ever change in the future.

Cannot connect to https://api.elephantsql.com from pg admin

has anyone success to create connection to elephantsql.org using pgadmin?
i want to try to store my database on a server and im trying to use elephantsqlcom
i want to connect to it using pg admin to make maintenance easier. i have followed this instruction : https://www.elephantsql.com/docs/pgadmin.html but keep getting this error
what should i do? thanks all
change database name from postgres to xwpgagbb similar to:
see user AND DEFAULT DATABASE are the same?..

Connecting locally to a HerokuConnect Postgres database

I'm building a simple web app that will deploy on Heroku, and using a Postgres database that is filled with an object from Salesforce. I did that with HerokuConnect and that works.
Now I want to see the contents of the database so that I know the table names, and I already know you can't do that on Heroku itself. So, I tried to connect to the database locally via heroku pg:psql but everytime I do that I get the error:
---> Connecting to DATABASE_URL
DL is deprecated, please use Fiddle
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "***.***.***.**" (**.***.***.***) and accepting
TCP/IP connections on port ****?
So that doesn't work. I tried the following but to no avail:
explicitly specifiying the name of the database
specifying host, user, database name, password, port and setting sslmode=require per the user guide and this question about connecting to a heroku postgresql database.
using the method above, but instead of using heroku psql I just used psql. That asked for a password but for a user I never created (a user with my corporate system name, because this is a corporate laptop)
reinstalling Postgres
Running heroku pg:info correctly lists my database information.
I am missing something, but I don't know what it is.
"DL is deprecated, please use Fiddle" is not an error but it's only a warning.
This is due to an issue with Ruby 2 on Windows.

PostgreSQL: One database to multiple user

I have PostgreSQL 9.3 version. I have created database name db1 now I need it to share with other users who all are connected with the LAN's to connect other applications with the same database.
In SQL Server: We can do this by selecting server name with login details.
Question:
Is it possible in PostgreSQL?
If yes, how can do this?
What is the procedure?
You will need to modify pg_hba.conf to allow remote connections to the database. Information about pg_hba.conf can be found here.
After that, you can connect programatically with a connection string, or similar to your image, with a GUI application like pgAdmin.
To connect (remotely or locally) from pgAdmin choose File -> Add Server... and enter the connection information into the dialog box. Here's an example of the window:
Your client computers will also need to have PostgreSQL drivers as well. If you're doing this in Windows, you'll probably be using ODBC. The PostgreSQL ODBC drivers are here. Info on the connection string format can be found here.
Here's an example of what pgAdmin looks like: