Sample Header Ad - 728x90

How do you add server connections on ubuntu version of pgAdmin?

0 votes
1 answer
54 views
I was sitting on pg14 for some time, while the postgresql package updates accumulated all the way up to 17, so the result of pg_lsclusters looks like this:
Ver Cluster Port Status Owner    Data directory              Log file
14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
15  main    5433 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log
16  main    5434 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postgresql-16-main.log
17  main    5435 online postgres /var/lib/postgresql/17/main /var/log/postgresql/postgresql-17-main.log
I only have a connection to version 14 in my pgAdmin panel, but how do I add connections for other servers? They require the password for postgres which I either don't know or don't remember.
The thing tripping me up is I think I had a setup step a while ago where I created a copy of postgres user with the same name as the admin account in the OS, or the package created it for me on install. Thus I've used that admin role in place of postgres for superuser needs and forgot about original superuser. Possibly I've set a password for postgres (most likely generated one) within old version of pgAdmin, saved it and completely forgot about it afterwards.
But now I need to actually migrate my database to the newest version and thus the problem at hand. Versions: - postgreSQL - 17.4 - pgAdmin - 9.1 - Ubuntu - 22.04.5 LTS **EDIT**: I can "enter" into the other cluster with sudo --user=postgres psql --port=5435 (without a password), but not when calling it with TCP/IP socket sudo --user=postgres psql --host=localhost --port=5435. However sudo --user=postgres psql --host=localhost, which enters into 5432 server, does ask for password, which matches password of the OS admin account.
This does confirm that I in fact changed the password for postgres db user of 5432 server in order to create a connection in pgAdmin, and other clusters were created by the package updates according to their mystical rules.
It still begs the question what IS the proper way of handling default postgres user for pgadmin connection while also preserving linux way of handling it as an OS user? Because now I think setting a password for it to connect was not a right call.
Asked by Biller Builder (288 rep)
Jun 5, 2025, 11:01 AM
Last activity: Jun 26, 2025, 06:58 PM