If I have a postgresql connection string:
export my_conn='postgresql://vadmin:[email protected]/prod'
how can I test this connection? I tried:
pqsl "$my_conn"
and it just hangs
If I have a postgresql connection string:
export my_conn='postgresql://vadmin:[email protected]/prod'
how can I test this connection? I tried:
pqsl "$my_conn"
and it just hangs
The best tool for the purpose is pg_isready.
Simply run
pg_isready -d "$my_conn"
and check the return code.
pqslvspsql) is just a typo in creating the question. If the above is hanging, I'd expect that your issue is some kind of connection issue between your server and the database you are connecting to. Maybe a firewall or routing issue, but also maybe a shell expansion issue. You might want to try to reformulate the connection directly from the command line usingpsql -U vadmin -h platform-prod.clfk51eo.us-west-2.rds.amazonaws.com -d prodto see if you are able to connect that way.