@@ -892,8 +892,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
892
892
<title>Specifying Multiple Hosts</title>
893
893
894
894
<para>
895
- It is possible to specify multiple hosts to connect to, so that they are
896
- tried in the given order. In the Keyword/Value format, the <literal>host</>,
895
+ It is possible to specify multiple hosts to connect to, so that they are
896
+ tried in the given order. In the Keyword/Value format, the <literal>host</>,
897
897
<literal>hostaddr</>, and <literal>port</> options accept a comma-separated
898
898
list of values. The same number of elements must be given in each option, such
899
899
that e.g. the first <literal>hostaddr</> corresponds to the first host name,
@@ -903,24 +903,24 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
903
903
</para>
904
904
905
905
<para>
906
- In the connection URI format, you can list multiple <literal>host:port</> pairs
906
+ In the connection URI format, you can list multiple <literal>host:port</> pairs
907
907
separated by commas, in the <literal>host</> component of the URI. In either
908
908
format, a single hostname can also translate to multiple network addresses. A
909
909
common example of this is a host that has both an IPv4 and an IPv6 address.
910
910
</para>
911
911
912
912
<para>
913
- When multiple hosts are specified, or when a single hostname is
914
- translated to multiple addresses, all the hosts and addresses will be
915
- tried in order, until one succeeds. If none of the hosts can be reached,
916
- the connection fails. If a connection is established successfully, but
913
+ When multiple hosts are specified, or when a single hostname is
914
+ translated to multiple addresses, all the hosts and addresses will be
915
+ tried in order, until one succeeds. If none of the hosts can be reached,
916
+ the connection fails. If a connection is established successfully, but
917
917
authentication fails, the remaining hosts in the list are not tried.
918
918
</para>
919
919
920
920
<para>
921
- If a password file is used, you can have different passwords for
922
- different hosts. All the other connection options are the same for every
923
- host, it is not possible to e.g. specify a different username for
921
+ If a password file is used, you can have different passwords for
922
+ different hosts. All the other connection options are the same for every
923
+ host, it is not possible to e.g. specify a different username for
924
924
different hosts.
925
925
</para>
926
926
</sect3>
@@ -1844,17 +1844,36 @@ int PQprotocolVersion(const PGconn *conn);
1844
1844
1845
1845
<listitem>
1846
1846
<para>
1847
- Returns an integer representing the backend version.
1847
+ Returns an integer representing the server version.
1848
1848
<synopsis>
1849
1849
int PQserverVersion(const PGconn *conn);
1850
1850
</synopsis>
1851
- Applications might use this function to determine the version of the database
1852
- server they are connected to. The number is formed by converting
1853
- the major, minor, and revision numbers into two-decimal-digit
1854
- numbers and appending them together. For example, version 8.1.5
1855
- will be returned as 80105, and version 8.2 will be returned as
1856
- 80200 (leading zeroes are not shown). Zero is returned if the
1857
- connection is bad.
1851
+ </para>
1852
+
1853
+ <para>
1854
+ Applications might use this function to determine the version of the
1855
+ database server they are connected to. The result is formed by
1856
+ multiplying the server's major version number by 10000 and adding
1857
+ the minor version number. For example, version 10.1 will be
1858
+ returned as 100001, and version 11.0 will be returned as 110000.
1859
+ Zero is returned if the connection is bad.
1860
+ </para>
1861
+
1862
+ <para>
1863
+ Prior to major version 10, <productname>PostgreSQL</> used
1864
+ three-part version numbers in which the first two parts together
1865
+ represented the major version. For those
1866
+ versions, <function>PQserverVersion</> uses two digits for each
1867
+ part; for example version 9.1.5 will be returned as 90105, and
1868
+ version 9.2.0 will be returned as 90200.
1869
+ </para>
1870
+
1871
+ <para>
1872
+ Therefore, for purposes of determining feature compatibility,
1873
+ applications should divide the result of <function>PQserverVersion</>
1874
+ by 100 not 10000 to determine a logical major version number.
1875
+ In all release series, only the last two digits differ between
1876
+ minor releases (bug-fix releases).
1858
1877
</para>
1859
1878
</listitem>
1860
1879
</varlistentry>
@@ -6224,26 +6243,42 @@ int PQlibVersion(void);
6224
6243
6225
6244
<para>
6226
6245
The result of this function can be used to determine, at
6227
- run time, if specific functionality is available in the currently
6246
+ run time, whether specific functionality is available in the currently
6228
6247
loaded version of libpq. The function can be used, for example,
6229
- to determine which connection options are available for
6230
- <function>PQconnectdb</> or if the <literal>hex</> <type>bytea</>
6231
- output added in PostgreSQL 9.0 is supported.
6248
+ to determine which connection options are available in
6249
+ <function>PQconnectdb</>.
6250
+ </para>
6251
+
6252
+ <para>
6253
+ The result is formed by multiplying the library's major version
6254
+ number by 10000 and adding the minor version number. For example,
6255
+ version 10.1 will be returned as 100001, and version 11.0 will be
6256
+ returned as 110000.
6257
+ </para>
6258
+
6259
+ <para>
6260
+ Prior to major version 10, <productname>PostgreSQL</> used
6261
+ three-part version numbers in which the first two parts together
6262
+ represented the major version. For those
6263
+ versions, <function>PQlibVersion</> uses two digits for each
6264
+ part; for example version 9.1.5 will be returned as 90105, and
6265
+ version 9.2.0 will be returned as 90200.
6232
6266
</para>
6233
6267
6234
6268
<para>
6235
- The number is formed by converting the major, minor, and revision
6236
- numbers into two-decimal-digit numbers and appending them together.
6237
- For example, version 9.1 will be returned as 90100, and version
6238
- 9.1.2 will be returned as 90102 (leading zeroes are not shown).
6269
+ Therefore, for purposes of determining feature compatibility,
6270
+ applications should divide the result of <function>PQlibVersion</>
6271
+ by 100 not 10000 to determine a logical major version number.
6272
+ In all release series, only the last two digits differ between
6273
+ minor releases (bug-fix releases).
6239
6274
</para>
6240
6275
6241
6276
<note>
6242
6277
<para>
6243
6278
This function appeared in <productname>PostgreSQL</> version 9.1, so
6244
6279
it cannot be used to detect required functionality in earlier
6245
- versions, since linking to it will create a link dependency
6246
- on version 9.1.
6280
+ versions, since calling it will create a link dependency
6281
+ on version 9.1 or later .
6247
6282
</para>
6248
6283
</note>
6249
6284
</listitem>
0 commit comments