We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I try to ping a database with the URL
postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
as described in the Postgres manual section "Connection Strings", I get the following error message:
parse postgresql://%2Fvar%2Flib%2Fpostgresql/dbname: invalid URL escape "%2F"
This is the same error you get if use use the Parse() method from net/url on that string.
Parse()
net/url
Here's the complete program:
package main import ( "database/sql" "fmt" _ "github.com/lib/pq" ) func main() { connStr := `postgresql://%2Fvar%2Flib%2Fpostgresql/dbname` db, _ := sql.Open("postgres", connStr) err := db.Ping() fmt.Println(err) }
It all works fine if I put the "host" in the query string (?host=/var/lib/postgresql).
?host=/var/lib/postgresql
The text was updated successfully, but these errors were encountered:
Can we please give this issue some love 😄
Sorry, something went wrong.
No branches or pull requests
If I try to ping a database with the URL
as described in the Postgres manual section "Connection Strings", I get the following error message:
This is the same error you get if use use the
Parse()
method fromnet/url
on that string.Here's the complete program:
It all works fine if I put the "host" in the query string (
?host=/var/lib/postgresql
).The text was updated successfully, but these errors were encountered: