microsoft / vscode-postgresql

PostgreSQL extension for VSCODE
Other
422 stars 53 forks source link

Connection to Postgres different than localhost fails on MacOS #18

Closed lamuertepeluda closed 5 years ago

lamuertepeluda commented 5 years ago

Steps to Reproduce:

  1. Create a connection different than localhost using hostname:port\dbname
  2. Error: PostgreSQL: Failed to connect: could not translate host name "HOSTNAME:PORT\DBNAME" to address: nodename nor servname provided, or not known

I don't even get what it means, but in my other client (Postico) I can connect

I also attempted other combinations but no luck. I'd really appreciate some non-localhost example :)

lamuertepeluda commented 5 years ago

Ok sorry for opening the issue. I think it was my server not supporting SSL and being on a different port. I made it work in Azure Data Studio like this:

Connection Type: PostgreSQL Server name: <your hostname> User name: <your username> Password: <your username> [Database name: <db name>]

Then press "Advanced" Port: <port> SSL mode: 'disable'

akamath46297 commented 5 years ago

@lamuertepeluda , in ADS the main workflow covers basic connection properties, things like port, SSL are in Advanced as you figured out. In Vscode you should be able to provide these details in the connection profile which is maintained in the user settings json as shown below. Could you try out this and let me know?

image

lamuertepeluda commented 5 years ago

@akamath46297 great! this solved my issue 😃

Is it a feature the fact that it requires the user login all the time I make a new connection, even if the user is set in the connection profile in pgsql.connections?

image

Anyway great job guys! I look forward for even cooler features like PostGIS support. I think this is just a very good start

akamath46297 commented 5 years ago

@lamuertepeluda, the fact that it asks for user name all the time in Vscode is a bug which we will be addressing before next release. We will also add port as an option during create connection workflow.

Thanks for the feedback :)

akamath46297 commented 5 years ago

@lamuertepeluda, port is now added as part of connection creation workflow. This is now fixed with Release 0.2.0