sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.63k stars 732 forks source link

connection specification problems #61

Closed petere closed 9 years ago

petere commented 9 years ago

This looks really cool, but I can't connect.

First attempt:

./pgweb_darwin_amd64 --url=postgresql://myhost:5433/mydb
Connecting to server...
Error: missing "=" after "postgresql://myhost:5433/mydb" in connection info string"

Admittedly, it is documented that URLs start with postgres:, not postgresql:, but it's an easy mistake to make, because libpq supports both. But in any case it shouldn't attempt to interpret a URL it cannot parse as a connection string and then give a bogus error message.

Next try:

./pgweb_darwin_amd64 --url=postgres://myhost:5433/mydb
Connecting to server...
Error: pq: SSL is not enabled on the server

I know the Go lib/pq is very particular about SSL, but the help does indicate that it is off by default:

  --ssl=       SSL option (disable)

But nothing of the sort

./pgweb_darwin_amd64 --url=postgres://myhost:5433/mydb --ssl=disable

works.

OK, so maybe in order to be able to set the SSL option, I cannot use URLs. Next try:

./pgweb_darwin_amd64 --host=myhost --port=5433 --db=mydb --ssl=disable
Connecting to server...
Error: pq: LDAP authentication failed for user "postgres"

So that worked, but why does it default the user to "postgres"? It ought default to my current user name.

Anyway, next try:

./pgweb_darwin_amd64 --host=myhost --port=5433 --db=mydb --ssl=disable --user="Peter Eisentraut"
Connecting to server...
Error: missing "=" after "Eisentraut" in connection info string"

So apparently it needs some quoting when it assembles the connection string?

sosedoff commented 9 years ago

Are you using pgweb binary from downloads ?

sosedoff commented 9 years ago

@petere ping

sosedoff commented 9 years ago

Added a note about invalid postgresql connection string format. Closing this since there's no response regarding my question.

petere commented 9 years ago

Yes.