PostgreSQL pgadmin error Unable to connect to Server

PostgreSQL pgadmin error Unable to connect to Server:

FATAL: Invalid username specified. Please check the Username and retry connection.
The Username should be in format.

PostgreSQL pgadmin error Unable to connect to Server

The above error received when try to connect to Azure PostgreSQL server from pgadmin tool.

Reason and Solution for PostgreSQL pgadmin error Unable to connect to Server

As error says we should give username as username@hostname like david@postgresqlserver1. Where username is david and postgresqlserver1 is the hostname. We can get these from Azure portal.

If you got this error when connecting to localhost. Then give username@localhost.

So solution is we have to provide username with hostname as highlighted below. Then, click on save to connect Azure PostgreSQL server or PostgreSQL server hosted in non-cloud environment.

PostgreSQL pgadmin error Unable to connect to Server