Connection to Azure postgres server fails in spite of correct username

Viewed 9102

When trying to connect to my postgres server in Azure from psql client, I get the following error, even though I am using the correct username. How can I fix this?

psql: FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in <username@hostname> format.

2 Answers

The @ sign in username works fine for objects but not connect strings. According to URI RFC-3986 username allows hex encoding. So replace the @ with %40. user@host:pw@fullhost becomes user%40host:pw@fullhost

Related