You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/src/sgml/protocol.sgml
+15-10Lines changed: 15 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@
97
97
Compression is especial useful for importing/exporting data to/from database using COPY command
98
98
and for replication (both physical and logical). Also compression can reduce server response time
99
99
in case of queries returning large amount of data (for example returning JSON, BLOBs, text,...)
100
-
Right now compression algorithm is hardcoded: is it is either zlib (default), either zstd (if Postgres was
100
+
Right now two libraries are supported: zlib (default) and zstd (if Postgres was
101
101
configured with --with-zstd option). In both cases streaming mode is used.
102
102
</para>
103
103
@@ -272,13 +272,15 @@
272
272
</varlistentry>
273
273
274
274
<varlistentry>
275
-
<term>CompressionOk</term>
275
+
<term>CompressionAck</term>
276
276
<listitem>
277
277
<para>
278
278
Server acknowledge using compression for client-server communication protocol.
279
279
Compression can be requested by client by including "compression" option in connection string.
280
-
Right now compression algorithm is hardcoded, but in future client and server may negotiate to
281
-
choose proper compression algorithm.
280
+
Client sends to the server list of compression algorithms, supported by client library.
281
+
If server supports one of this algorithms, then it acknowledges use of this algorithm and then all libpq messages send both from client to server and
282
+
visa versa will be compressed. If server is not supporting any of the suggested algorithms, then it replies with 'n' (no compression)
283
+
message and it is up to the client whether to continue work without compression or report error.
282
284
</para>
283
285
</listitem>
284
286
</varlistentry>
@@ -3421,7 +3423,7 @@ AuthenticationSASLFinal (B)
3421
3423
3422
3424
<varlistentry>
3423
3425
<term>
3424
-
CompressionOk (B)
3426
+
CompressionAck (B)
3425
3427
</term>
3426
3428
<listitem>
3427
3429
<para>
@@ -3433,7 +3435,11 @@ CompressionOk (B)
3433
3435
</term>
3434
3436
<listitem>
3435
3437
<para>
3436
-
Acknowledge use of compression for protocol data. After receiving this message bother server and client are switched to compression mode
3438
+
Acknowledge use of compression for protocol data. Client sends to the server list of compression algorithms, supported by client library.
3439
+
If server supports one of this algorithms, then it responds with CompressionAck with identifier (letter) of first such algorithm.
3440
+
If server is not supporting any of the suggested algorithms, then it replies with 'n' (no compression) algorithm.
3441
+
It is up to the client whether to continue work without compression or report error.
3442
+
After receiving this message with algorithm identifer aother than 'n', both server and client are switched to compression mode
3437
3443
and exchange compressed messages.
3438
3444
</para>
3439
3445
</listitem>
@@ -3454,7 +3460,7 @@ CompressionOk (B)
3454
3460
</term>
3455
3461
<listitem>
3456
3462
<para>
3457
-
Used compression algorithm. Right now the following streaming compression algorithms are supported: 'f' - Facebook zstd, 'z' - zlib.
3463
+
Used compression algorithm. Right now the following streaming compression algorithms are supported: 'f' - Facebook zstd, 'z' - zlib, 'n' - no compresion.
3458
3464
</para>
3459
3465
</listitem>
3460
3466
</varlistentry>
@@ -5888,9 +5894,8 @@ StartupMessage (F)
5888
5894
</term>
5889
5895
<listitem>
5890
5896
<para>
5891
-
Request compression of libpq traffic. Value can be
0 commit comments