question

vidar-3668 avatar image
0 Votes"
vidar-3668 asked OuryBa-MSFT commented

Connect to Azure Database for PostgreSQL flexible server from SQL Shell

hi
I'm trying to connect to my postgres flexible server from my office PC using PSQL shell. That's it - nothing complex, just complete beginner stuff here! I won't even get onto Navicat here...

When I get to the enter username: and press return, I get this error:

 error: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "foo-flex-server.postgres.database.azure.com" (23.38.145.57) and accepting TCP/IP connections on port 5432?

I have added my IP of my office/dev PC computer to the whitelist too, but this doesn't seem to have changed anything.

Don't know where to start with this one. Any ideas?

azure-database-postgresql
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @vidar-3668 Thank you for posting your question. Which of the networking options have you created your Azure PostgreSQL server Private access (VNet integration) or Public access (allowed IP addresses)?


Regards,
Oury

0 Votes 0 ·

Public access.

II think I've sorted it though - I have tried on my own personal PC and installed on C drive the PSQL command line and it seems to work.

I installed the PSQL command line on my D drive and I don't think it liked that at all! Complaining about the "system can't find the path" (despite messing about with Environment Variables, something that you don't have to bother with ordinarily with).

The issue is with our company's firewall which seems to blocking port 5432 - I'm almost 99% sure that is the problem.

0 Votes 0 ·

Hi @vidar-3668 I am glad it worked. Please feel free to reach out if you have additional queries.

Regards,
Oury

0 Votes 0 ·

0 Answers