diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 34c0bc816c5..9905b2a2899 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -796,7 +796,7 @@ PGPing PQping(const char *conninfo);
Several libpq> functions parse a user-specified string to obtain
connection parameters. There are two accepted formats for these strings:
- plain keyword = value strings
+ plain keyword/value strings
and URIs. URIs generally follow
RFC
3986, except that multi-host connection strings are allowed
@@ -807,12 +807,14 @@ PGPing PQping(const char *conninfo);
Keyword/Value Connection Strings
- In the first format, each parameter setting is in the form
- keyword = value. Spaces around the equal sign are
+ In the keyword/value format, each parameter setting is in the form
+ keyword =
+ value, with space(s) between settings.
+ Spaces around a setting's equal sign are
optional. To write an empty value, or a value containing spaces, surround it
- with single quotes, e.g., keyword = 'a value'. Single
- quotes and backslashes within
- the value must be escaped with a backslash, i.e., \' and
+ with single quotes, for example keyword = 'a value'.
+ Single quotes and backslashes within
+ a value must be escaped with a backslash, i.e., \' and
\\.
@@ -835,7 +837,19 @@ host=localhost port=5432 dbname=mydb connect_timeout=10
The general form for a connection URI is:
-postgresql://[user[:password]@][host][:port][,...][/dbname][?param1=value1&...]
+postgresql://userspec@hostspec/dbname?paramspec
+
+where userspec is:
+
+user:password
+
+and hostspec is:
+
+host:port,...
+
+and paramspec is:
+
+name=value&...
@@ -903,7 +917,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
port component, in a single URI. A URI of the form
postgresql://host1:port1,host2:port2,host3:port3/
is equivalent to a connection string of the form
- host=host1,host2,host3 port=port1,port2,port3. Each
+ host=host1,host2,host3 port=port1,port2,port3.
+ As further described below, each
host will be tried in turn until a connection is successfully established.
@@ -914,8 +929,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
It is possible to specify multiple hosts to connect to, so that they are
tried in the given order. In the Keyword/Value format, the host>,
- hostaddr>, and port> options accept a comma-separated
- list of values. The same number of elements must be given in each
+ hostaddr>, and port> options accept comma-separated
+ lists of values. The same number of elements must be given in each
option that is specified, such
that e.g., the first hostaddr> corresponds to the first host name,
the second hostaddr> corresponds to the second host name, and so
@@ -925,7 +940,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
In the connection URI format, you can list multiple host:port> pairs
- separated by commas, in the host> component of the URI.
+ separated by commas in the host> component of the URI.