@@ -865,7 +865,7 @@ PQsslKeyPassHook_OpenSSL_type PQgetSSLKeyPassHook_OpenSSL(void);
865
865
<para>
866
866
Several <application>libpq</application> functions parse a user-specified string to obtain
867
867
connection parameters. There are two accepted formats for these strings:
868
- plain<literal> keyword = value</literal> strings
868
+ plain keyword/value strings
869
869
and URIs. URIs generally follow
870
870
<ulink url="https://tools.ietf.org/html/rfc3986">RFC
871
871
3986</ulink>, except that multi-host connection strings are allowed
@@ -876,12 +876,14 @@ PQsslKeyPassHook_OpenSSL_type PQgetSSLKeyPassHook_OpenSSL(void);
876
876
<title>Keyword/Value Connection Strings</title>
877
877
878
878
<para>
879
- In the first format, each parameter setting is in the form
880
- <literal>keyword = value</literal>. Spaces around the equal sign are
879
+ In the keyword/value format, each parameter setting is in the form
880
+ <replaceable>keyword</replaceable> <literal>=</literal>
881
+ <replaceable>value</replaceable>, with space(s) between settings.
882
+ Spaces around a setting's equal sign are
881
883
optional. To write an empty value, or a value containing spaces, surround it
882
- with single quotes,e.g., <literal>keyword = 'a value'</literal>. Single
883
- quotes and backslashes within
884
- the value must be escaped with a backslash, i.e., <literal>\'</literal> and
884
+ with single quotes,for example <literal>keyword = 'a value'</literal>.
885
+ Single quotes and backslashes within
886
+ a value must be escaped with a backslash, i.e., <literal>\'</literal> and
885
887
<literal>\\</literal>.
886
888
</para>
887
889
@@ -904,7 +906,19 @@ host=localhost port=5432 dbname=mydb connect_timeout=10
904
906
<para>
905
907
The general form for a connection <acronym>URI</acronym> is:
906
908
<synopsis>
907
- postgresql://[user[:password]@][host][:port][,...][/dbname][?param1=value1&...]
909
+ postgresql://<optional><replaceable>userspec</replaceable>@</optional><optional><replaceable>hostspec</replaceable></optional><optional>/<replaceable>dbname</replaceable></optional><optional>?<replaceable>paramspec</replaceable></optional>
910
+
911
+ <phrase>where <replaceable>userspec</replaceable> is:</phrase>
912
+
913
+ <replaceable>user</replaceable><optional>:<replaceable>password</replaceable></optional>
914
+
915
+ <phrase>and <replaceable>hostspec</replaceable> is:</phrase>
916
+
917
+ <optional><replaceable>host</replaceable></optional><optional>:<replaceable>port</replaceable></optional><optional>,...</optional>
918
+
919
+ <phrase>and <replaceable>paramspec</replaceable> is:</phrase>
920
+
921
+ <replaceable>name</replaceable>=<replaceable>value</replaceable><optional>&...</optional>
908
922
</synopsis>
909
923
</para>
910
924
@@ -977,7 +991,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
977
991
port component, in a single URI. A URI of the form
978
992
<literal>postgresql://host1:port1,host2:port2,host3:port3/</literal>
979
993
is equivalent to a connection string of the form
980
- <literal>host=host1,host2,host3 port=port1,port2,port3</literal>. Each
994
+ <literal>host=host1,host2,host3 port=port1,port2,port3</literal>.
995
+ As further described below, each
981
996
host will be tried in turn until a connection is successfully established.
982
997
</para>
983
998
</sect3>
@@ -988,8 +1003,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
988
1003
<para>
989
1004
It is possible to specify multiple hosts to connect to, so that they are
990
1005
tried in the given order. In the Keyword/Value format, the <literal>host</literal>,
991
- <literal>hostaddr</literal>, and <literal>port</literal> options accepta comma-separated
992
- list of values. The same number of elements must be given in each
1006
+ <literal>hostaddr</literal>, and <literal>port</literal> options accept comma-separated
1007
+ lists of values. The same number of elements must be given in each
993
1008
option that is specified, such
994
1009
that e.g., the first <literal>hostaddr</literal> corresponds to the first host name,
995
1010
the second <literal>hostaddr</literal> corresponds to the second host name, and so
@@ -999,7 +1014,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
999
1014
1000
1015
<para>
1001
1016
In the connection URI format, you can list multiple <literal>host:port</literal> pairs
1002
- separated by commas, in the <literal>host</literal> component of the URI.
1017
+ separated by commas in the <literal>host</literal> component of the URI.
1003
1018
</para>
1004
1019
1005
1020
<para>