space-cloud icon indicating copy to clipboard operation
space-cloud copied to clipboard

How to input password with special characters to postgres connection string

Open ghost opened this issue 6 years ago • 2 comments

Describe the bug

space-cloud throws error when i try to connect to my google cloud postgres db instance with special password: My password format: Hj#aFxcv736#3cC^6

Here is the error parse postgres://simple:Ng: invalid port ":Ng" after host

Expected behaviour

Should connect successfully.

Actual behaviour

Throw unhelpful error.

Steps to reproduce

Your environment

  • Space Cloud version: v0.14.0
  • OS: Windows 10 Pro 1909
  • The client api version (if applicable):
  • Browser (if applicable): Edge Chromium latest

If this bug restricts your use of space-cloud, give it a thumbs up reaction, so that we can determine which bugs need to be fixed immediately. 👍

Another suggestion is that space-cloud's Mission control should have the About or something so i can copy and paste the version, OS, browser ...

ghost avatar Dec 12 '19 06:12 ghost

I think this can be fixed by providing the connection string in this format: "user=pqgotest password='your pass with special characters' dbname=pqgotest sslmode=verify-full".

These are the fields currently supported.

* dbname - The name of the database to connect to
* user - The user to sign in as
* password - The user's password
* host - The host to connect to. Values that start with / are for unix
  domain sockets. (default is localhost)
* port - The port to bind to. (default is 5432)
* sslmode - Whether or not to use SSL (default is require, this is not
  the default for libpq)
* fallback_application_name - An application_name to fall back to if one isn't provided.
* connect_timeout - Maximum wait for connection, in seconds. Zero or
  not specified means wait indefinitely.
* sslcert - Cert file location. The file must contain PEM encoded data.
* sslkey - Key file location. The file must contain PEM encoded data.
* sslrootcert - The location of the root certificate file. The file
  must contain PEM encoded data.

More info: https://godoc.org/github.com/lib/pq

This is more of a documentation problem than a bug since the feature is already implemented. Thanks for bringing it to our notice @vuhg

YourTechBud avatar Jan 06 '20 03:01 YourTechBud

You can URL encode you password for such use cases.

YourTechBud avatar Dec 05 '20 06:12 YourTechBud