I recently spun up a Postgres database on Azure and I'm having a lot of trouble figuring out my DB URI. The creds look something like:
Server: name.postgres.database.azure.com
User (admin role): admin@name
Password: mypassword
DB name: postgres
So I'm trying to use psql
and pass in the connection string, psql postgresql://admin@name:mypassword@name.postgres.database.azure.com:5432/postgres
But it's giving me an error
psql: could not translate host name "name" to address: nodename nor servname provided, or not known
Interestingly enough, this works:
psql -h name.postgres.database.azure.com -p 5432 -U admin@name postgres
The reason why I ask is because I want to use Python and sqlalchemy and want to pass in the DB uri string.