Why can't I connect to my managed postgres db cluster?

Posted November 8, 2020 555 views
PostgreSQLDigitalOcean Managed PostgreSQL Database

This is my connection parameter, everything is copied straight from the cluster address details into my OS environment variables.

host = {
    "host" : os.environ.get('DO_HOST'),
    "database" : os.environ.get('DO_DB'),
    "user" : doadmin,
    "password" : os.environ.get('DO_PASSWORD'),

However, I see that this doesn’t work, and instead get this error, anjar is my windows username. My postgres driver has always worked, the issue is purely me trying to connect to the remote cluster via these parameters.

FATAL:  role "anjar" does not exist

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @ajaramillocastro,

What is the SQL client that you are using to connect to your Managed Database Cluster?

As far as I can see from the error, it is just that your username is not picked up correctly by your SQL client and it defaults to your OS username.