This commit is contained in:
Steven Fackler 2016-03-27 13:06:12 -07:00
parent b0bed6ab4c
commit 9a595c9d3c
2 changed files with 12 additions and 12 deletions

View File

@ -74,11 +74,11 @@ let conn = try!(Connection::connect("postgres://user:pass@host:port/database?arg
defaults to the value of `user` if not specified. The driver supports `trust`,
`password`, and `md5` authentication.
Unix domain sockets can be used as well by activating the `unix_socket` feature.
The `host` portion of the URI should be set to the absolute path to the
directory containing the socket file. Since `/` is a reserved character in
URLs, the path should be URL encoded. If Postgres stored its socket files in
`/run/postgres`, the connection would then look like:
Unix domain sockets can be used as well by activating the `unix_socket` or
`nightly` features. The `host` portion of the URI should be set to the absolute
path to the directory containing the socket file. Since `/` is a reserved
character in URLs, the path should be URL encoded. If Postgres stored its socket
files in `/run/postgres`, the connection would then look like:
```rust
let conn = try!(Connection::connect("postgres://postgres@%2Frun%2Fpostgres", SslMode::None));
```

View File

@ -1020,13 +1020,13 @@ impl Connection {
/// (5432) is used if none is specified. The database name defaults to the
/// username if not specified.
///
/// Connection via Unix sockets is supported with the `unix_socket`
/// feature. To connect to the server via Unix sockets, `host` should be
/// set to the absolute path of the directory containing the socket file.
/// Since `/` is a reserved character in URLs, the path should be URL
/// encoded. If the path contains non-UTF 8 characters, a `ConnectParams`
/// struct should be created manually and passed in. Note that Postgres
/// does not support SSL over Unix sockets.
/// Connection via Unix sockets is supported with either the `unix_socket`
/// or `nightly` features. To connect to the server via Unix sockets, `host`
/// should be set to the absolute path of the directory containing the
/// socket file. Since `/` is a reserved character in URLs, the path should
/// be URL encoded. If the path contains non-UTF 8 characters, a
/// `ConnectParams` struct should be created manually and passed in. Note
/// that Postgres does not support SSL over Unix sockets.
///
/// # Examples
///