How to input password with special characters to postgres connection string
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 ...
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
You can URL encode you password for such use cases.