-
-
Notifications
You must be signed in to change notification settings - Fork 935
Closed
Labels
Description
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.
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).
zombiezen, cptaffe, pinyin, jkhsjdhjs, xfmoulet and 6 more