Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e22efaa

Browse files
committed
Doc: update versioning information in libpq.sgml.
The descriptions of PQserverVersion and PQlibVersion hadn't been updated for the new two-part version-numbering approach. Fix that. In passing, remove some trailing whitespace elsewhere in the file.
1 parent a46fe6e commit e22efaa

File tree

1 file changed

+63
-28
lines changed

1 file changed

+63
-28
lines changed

doc/src/sgml/libpq.sgml

+63-28
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
892892
<title>Specifying Multiple Hosts</title>
893893

894894
<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</>,
897897
<literal>hostaddr</>, and <literal>port</> options accept a comma-separated
898898
list of values. The same number of elements must be given in each option, such
899899
that e.g. the first <literal>hostaddr</> corresponds to the first host name,
@@ -903,24 +903,24 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
903903
</para>
904904

905905
<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
907907
separated by commas, in the <literal>host</> component of the URI. In either
908908
format, a single hostname can also translate to multiple network addresses. A
909909
common example of this is a host that has both an IPv4 and an IPv6 address.
910910
</para>
911911

912912
<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
917917
authentication fails, the remaining hosts in the list are not tried.
918918
</para>
919919

920920
<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
924924
different hosts.
925925
</para>
926926
</sect3>
@@ -1844,17 +1844,36 @@ int PQprotocolVersion(const PGconn *conn);
18441844

18451845
<listitem>
18461846
<para>
1847-
Returns an integer representing the backend version.
1847+
Returns an integer representing the server version.
18481848
<synopsis>
18491849
int PQserverVersion(const PGconn *conn);
18501850
</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).
18581877
</para>
18591878
</listitem>
18601879
</varlistentry>
@@ -6224,26 +6243,42 @@ int PQlibVersion(void);
62246243

62256244
<para>
62266245
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
62286247
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.
62326266
</para>
62336267

62346268
<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).
62396274
</para>
62406275

62416276
<note>
62426277
<para>
62436278
This function appeared in <productname>PostgreSQL</> version 9.1, so
62446279
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.
62476282
</para>
62486283
</note>
62496284
</listitem>

0 commit comments

Comments
 (0)