Where to find your PostgreSQL credentials in pgAdmin 4

Your PostgreSQL username and password are stored in the connection settings for each server you've added to pgAdmin 4. To view them, open pgAdmin 4, right-click on the server name in the left panel under "Servers", and select Properties. The username appears on the "General" tab. The password is not displayed in plain text for security reasons, but you can reset it or view it depending on how you saved it initially.

If you saved the password when you first connected, pgAdmin 4 stores it in an encrypted file on your computer. You cannot retrieve the original password through the interface, but you can enter a new one and save it. If you did not save the password, you will need to enter it each time you connect, or you can add it now through the Properties dialog.

Key Takeaways

  • Right-click any server name under "Servers" in pgAdmin 4 and select Properties to see the username on the General tab.
  • Saved passwords are encrypted and cannot be viewed in plain text through pgAdmin 4 for security.
  • You can reset a password or save a new one by editing the server connection settings and checking the "Save password?" box.
  • If you forgot your PostgreSQL password entirely, you will need to reset it through the PostgreSQL server itself, not through pgAdmin 4.

Viewing the username on the General tab

Open pgAdmin 4 and locate the server you want to check in the left sidebar. Under the "Servers" folder, you will see a list of all PostgreSQL servers you have connected to. Right-click the server name and choose Properties from the menu.

A Properties window will open. Click the General tab if it is not already selected. The username field shows the PostgreSQL user account you used to connect to that server. This is typically "postgres" if you used the default account, or a custom username if you created a different user.

Why the password field is blank or hidden

When you open the Properties window and look at the Connection tab, you may see a "Password" field that appears empty or shows dots. This is intentional. pgAdmin 4 encrypts saved passwords and does not display them in the interface, even if you saved one when you first connected.

This design protects your credentials from being accidentally visible on screen or copied by other programs. If you need to change the password or confirm you have one saved, you can check the "Save password?" checkbox and enter a new password, then click Save.

Resetting or updating a saved password

To change the password for a server connection in pgAdmin 4, right-click the server and select Properties. Go to the Connection tab. In the "Password" field, enter the new password you want to use. Check the box labeled Save password? to store it in pgAdmin 4.

Click the Save button at the bottom of the Properties window. The next time you connect to that server, pgAdmin 4 will use the new password. If you leave the password field empty and uncheck "Save password?", pgAdmin 4 will prompt you to enter the password each time you connect.

Finding your password if you lost it entirely

If you do not remember your PostgreSQL password and did not save it in pgAdmin 4, you cannot recover it through pgAdmin 4 itself. You will need to reset it on the PostgreSQL server. On Windows, you can restart the PostgreSQL service in recovery mode. On Linux or macOS, you can edit the PostgreSQL configuration to allow local connections without a password, then reset the password using the psql command-line tool.

The exact steps depend on your operating system and PostgreSQL version. Contact your database administrator or refer to the PostgreSQL documentation for your version if you need help resetting the password at the server level.

Checking connection details for multiple servers

If you have added multiple PostgreSQL servers to pgAdmin 4, each one has its own username and connection settings. You can view them all by checking the Properties of each server one at a time. Right-click each server name, select Properties, and note the username on the General tab and the hostname on the Connection tab.

This is useful if you manage several PostgreSQL instances and need to confirm which credentials are associated with each one. You can also rename a server in pgAdmin 4 to make it easier to remember which one is which — for example, "Production Database" or "Local Development".

What to do if you cannot connect even with the correct username

If you know your username and password but pgAdmin 4 still cannot connect, the issue may be with the host address, port number, or database permissions rather than the credentials themselves. Check the Connection tab in Properties and confirm the hostname (usually "localhost" for a local server) and port (usually 5432 for PostgreSQL) are correct.

If those are correct, the PostgreSQL server may not be running, or the user account may not have permission to connect from your computer. Try connecting using the psql command-line tool with the same username and password to narrow down whether the problem is with pgAdmin 4 or with the server itself.

Frequently Asked Questions

Can I see my saved password in pgAdmin 4?

No. pgAdmin 4 encrypts saved passwords and does not display them in the interface for security. If you need to change it, you can enter a new password in the Connection tab and save it.

What if I see "postgres" as the username but do not remember setting that up?

"postgres" is the default superuser account created when PostgreSQL is installed. If you connected using that account, it will show in pgAdmin 4. You can create additional user accounts with different names and permissions if you prefer not to use the default account.

How do I know if my password is actually saved in pgAdmin 4?

If the "Save password?" checkbox is checked on the Connection tab, your password is saved. If it is unchecked, pgAdmin 4 will ask you to enter the password each time you connect to that server.

Can I change my PostgreSQL password through pgAdmin 4?

You can update the password that pgAdmin 4 uses to connect by entering a new one in the Connection tab and saving it. However, this only changes what pgAdmin 4 stores locally. To change the actual PostgreSQL user password on the server, use the ALTER USER command in pgAdmin 4's Query Tool or the psql command line.

What should I do if I forgot the password for the "postgres" superuser?

You will need to reset it at the PostgreSQL server level. On Windows, restart the PostgreSQL service in recovery mode. On Linux or macOS, you can modify the PostgreSQL configuration to allow local connections without authentication, then use psql to reset the password. Refer to your PostgreSQL documentation for detailed steps.