]> begriffs open source - ai-pg/blob - full-docs/txt/protocol-message-formats.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / protocol-message-formats.txt
1
2 54.7. Message Formats #
3
4    This section describes the detailed format of each message. Each is
5    marked to indicate that it can be sent by a frontend (F), a backend
6    (B), or both (F & B). Notice that although each message includes a byte
7    count at the beginning, most messages are defined so that the message
8    end can be found without reference to the byte count. This is for
9    historical reasons, as the original, now-obsolete protocol version 2
10    did not have an explicit length field. It also aids validity checking
11    though.
12
13    AuthenticationOk (B) #
14
15         Byte1('R')
16                 Identifies the message as an authentication request.
17
18         Int32(8)
19                 Length of message contents in bytes, including self.
20
21         Int32(0)
22                 Specifies that the authentication was successful.
23
24    AuthenticationKerberosV5 (B) #
25
26         Byte1('R')
27                 Identifies the message as an authentication request.
28
29         Int32(8)
30                 Length of message contents in bytes, including self.
31
32         Int32(2)
33                 Specifies that Kerberos V5 authentication is required.
34
35    AuthenticationCleartextPassword (B) #
36
37         Byte1('R')
38                 Identifies the message as an authentication request.
39
40         Int32(8)
41                 Length of message contents in bytes, including self.
42
43         Int32(3)
44                 Specifies that a clear-text password is required.
45
46    AuthenticationMD5Password (B) #
47
48         Byte1('R')
49                 Identifies the message as an authentication request.
50
51         Int32(12)
52                 Length of message contents in bytes, including self.
53
54         Int32(5)
55                 Specifies that an MD5-encrypted password is required.
56
57         Byte4
58                 The salt to use when encrypting the password.
59
60    AuthenticationGSS (B) #
61
62         Byte1('R')
63                 Identifies the message as an authentication request.
64
65         Int32(8)
66                 Length of message contents in bytes, including self.
67
68         Int32(7)
69                 Specifies that GSSAPI authentication is required.
70
71    AuthenticationGSSContinue (B) #
72
73         Byte1('R')
74                 Identifies the message as an authentication request.
75
76         Int32
77                 Length of message contents in bytes, including self.
78
79         Int32(8)
80                 Specifies that this message contains GSSAPI or SSPI data.
81
82         Byten
83                 GSSAPI or SSPI authentication data.
84
85    AuthenticationSSPI (B) #
86
87         Byte1('R')
88                 Identifies the message as an authentication request.
89
90         Int32(8)
91                 Length of message contents in bytes, including self.
92
93         Int32(9)
94                 Specifies that SSPI authentication is required.
95
96    AuthenticationSASL (B) #
97
98         Byte1('R')
99                 Identifies the message as an authentication request.
100
101         Int32
102                 Length of message contents in bytes, including self.
103
104         Int32(10)
105                 Specifies that SASL authentication is required.
106
107           The message body is a list of SASL authentication mechanisms, in
108           the server's order of preference. A zero byte is required as
109           terminator after the last authentication mechanism name. For
110           each mechanism, there is the following:
111
112         String
113                 Name of a SASL authentication mechanism.
114
115    AuthenticationSASLContinue (B) #
116
117         Byte1('R')
118                 Identifies the message as an authentication request.
119
120         Int32
121                 Length of message contents in bytes, including self.
122
123         Int32(11)
124                 Specifies that this message contains a SASL challenge.
125
126         Byten
127                 SASL data, specific to the SASL mechanism being used.
128
129    AuthenticationSASLFinal (B) #
130
131         Byte1('R')
132                 Identifies the message as an authentication request.
133
134         Int32
135                 Length of message contents in bytes, including self.
136
137         Int32(12)
138                 Specifies that SASL authentication has completed.
139
140         Byten
141                 SASL outcome "additional data", specific to the SASL
142                 mechanism being used.
143
144    BackendKeyData (B) #
145
146         Byte1('K')
147                 Identifies the message as cancellation key data. The
148                 frontend must save these values if it wishes to be able to
149                 issue CancelRequest messages later.
150
151         Int32
152                 Length of message contents in bytes, including self.
153
154         Int32
155                 The process ID of this backend.
156
157         Byten
158                 The secret key of this backend. This field extends to the
159                 end of the message, indicated by the length field.
160
161                 The minimum and maximum key length are 4 and 256 bytes,
162                 respectively. The PostgreSQL server only sends keys up to
163                 32 bytes, but the larger maximum size allows for future
164                 server versions, as well as connection poolers and other
165                 middleware, to use longer keys. One possible use case is
166                 augmenting the server's key with extra information.
167                 Middleware is therefore also encouraged to not use up all
168                 of the bytes, in case multiple middleware applications are
169                 layered on top of each other, each of which may wrap the
170                 key with extra data.
171
172           Before protocol version 3.2, the secret key was always 4 bytes
173           long.
174
175    Bind (F) #
176
177         Byte1('B')
178                 Identifies the message as a Bind command.
179
180         Int32
181                 Length of message contents in bytes, including self.
182
183         String
184                 The name of the destination portal (an empty string
185                 selects the unnamed portal).
186
187         String
188                 The name of the source prepared statement (an empty string
189                 selects the unnamed prepared statement).
190
191         Int16
192                 The number of parameter format codes that follow (denoted
193                 C below). This can be zero to indicate that there are no
194                 parameters or that the parameters all use the default
195                 format (text); or one, in which case the specified format
196                 code is applied to all parameters; or it can equal the
197                 actual number of parameters.
198
199         Int16[C]
200                 The parameter format codes. Each must presently be zero
201                 (text) or one (binary).
202
203         Int16
204                 The number of parameter values that follow (possibly
205                 zero). This must match the number of parameters needed by
206                 the query.
207
208           Next, the following pair of fields appear for each parameter:
209
210         Int32
211                 The length of the parameter value, in bytes (this count
212                 does not include itself). Can be zero. As a special case,
213                 -1 indicates a NULL parameter value. No value bytes follow
214                 in the NULL case.
215
216         Byten
217                 The value of the parameter, in the format indicated by the
218                 associated format code. n is the above length.
219
220           After the last parameter, the following fields appear:
221
222         Int16
223                 The number of result-column format codes that follow
224                 (denoted R below). This can be zero to indicate that there
225                 are no result columns or that the result columns should
226                 all use the default format (text); or one, in which case
227                 the specified format code is applied to all result columns
228                 (if any); or it can equal the actual number of result
229                 columns of the query.
230
231         Int16[R]
232                 The result-column format codes. Each must presently be
233                 zero (text) or one (binary).
234
235    BindComplete (B) #
236
237         Byte1('2')
238                 Identifies the message as a Bind-complete indicator.
239
240         Int32(4)
241                 Length of message contents in bytes, including self.
242
243    CancelRequest (F) #
244
245         Int32(16)
246                 Length of message contents in bytes, including self.
247
248         Int32(80877102)
249                 The cancel request code. The value is chosen to contain
250                 1234 in the most significant 16 bits, and 5678 in the
251                 least significant 16 bits. (To avoid confusion, this code
252                 must not be the same as any protocol version number.)
253
254         Int32
255                 The process ID of the target backend.
256
257         Byten
258                 The secret key for the target backend. This field extends
259                 to the end of the message, indicated by the length field.
260                 The maximum key length is 256 bytes.
261
262           Before protocol version 3.2, the secret key was always 4 bytes
263           long.
264
265    Close (F) #
266
267         Byte1('C')
268                 Identifies the message as a Close command.
269
270         Int32
271                 Length of message contents in bytes, including self.
272
273         Byte1
274                 'S' to close a prepared statement; or 'P' to close a
275                 portal.
276
277         String
278                 The name of the prepared statement or portal to close (an
279                 empty string selects the unnamed prepared statement or
280                 portal).
281
282    CloseComplete (B) #
283
284         Byte1('3')
285                 Identifies the message as a Close-complete indicator.
286
287         Int32(4)
288                 Length of message contents in bytes, including self.
289
290    CommandComplete (B) #
291
292         Byte1('C')
293                 Identifies the message as a command-completed response.
294
295         Int32
296                 Length of message contents in bytes, including self.
297
298         String
299                 The command tag. This is usually a single word that
300                 identifies which SQL command was completed.
301
302                 For an INSERT command, the tag is INSERT oid rows, where
303                 rows is the number of rows inserted. oid used to be the
304                 object ID of the inserted row if rows was 1 and the target
305                 table had OIDs, but OIDs system columns are not supported
306                 anymore; therefore oid is always 0.
307
308                 For a DELETE command, the tag is DELETE rows where rows is
309                 the number of rows deleted.
310
311                 For an UPDATE command, the tag is UPDATE rows where rows
312                 is the number of rows updated.
313
314                 For a MERGE command, the tag is MERGE rows where rows is
315                 the number of rows inserted, updated, or deleted.
316
317                 For a SELECT or CREATE TABLE AS command, the tag is SELECT
318                 rows where rows is the number of rows retrieved.
319
320                 For a MOVE command, the tag is MOVE rows where rows is the
321                 number of rows the cursor's position has been changed by.
322
323                 For a FETCH command, the tag is FETCH rows where rows is
324                 the number of rows that have been retrieved from the
325                 cursor.
326
327                 For a COPY command, the tag is COPY rows where rows is the
328                 number of rows copied. (Note: the row count appears only
329                 in PostgreSQL 8.2 and later.)
330
331    CopyData (F & B) #
332
333         Byte1('d')
334                 Identifies the message as COPY data.
335
336         Int32
337                 Length of message contents in bytes, including self.
338
339         Byten
340                 Data that forms part of a COPY data stream. Messages sent
341                 from the backend will always correspond to single data
342                 rows, but messages sent by frontends might divide the data
343                 stream arbitrarily.
344
345    CopyDone (F & B) #
346
347         Byte1('c')
348                 Identifies the message as a COPY-complete indicator.
349
350         Int32(4)
351                 Length of message contents in bytes, including self.
352
353    CopyFail (F) #
354
355         Byte1('f')
356                 Identifies the message as a COPY-failure indicator.
357
358         Int32
359                 Length of message contents in bytes, including self.
360
361         String
362                 An error message to report as the cause of failure.
363
364    CopyInResponse (B) #
365
366         Byte1('G')
367                 Identifies the message as a Start Copy In response. The
368                 frontend must now send copy-in data (if not prepared to do
369                 so, send a CopyFail message).
370
371         Int32
372                 Length of message contents in bytes, including self.
373
374         Int8
375                 0 indicates the overall COPY format is textual (rows
376                 separated by newlines, columns separated by separator
377                 characters, etc.). 1 indicates the overall copy format is
378                 binary (similar to DataRow format). See COPY for more
379                 information.
380
381         Int16
382                 The number of columns in the data to be copied (denoted N
383                 below).
384
385         Int16[N]
386                 The format codes to be used for each column. Each must
387                 presently be zero (text) or one (binary). All must be zero
388                 if the overall copy format is textual.
389
390    CopyOutResponse (B) #
391
392         Byte1('H')
393                 Identifies the message as a Start Copy Out response. This
394                 message will be followed by copy-out data.
395
396         Int32
397                 Length of message contents in bytes, including self.
398
399         Int8
400                 0 indicates the overall COPY format is textual (rows
401                 separated by newlines, columns separated by separator
402                 characters, etc.). 1 indicates the overall copy format is
403                 binary (similar to DataRow format). See COPY for more
404                 information.
405
406         Int16
407                 The number of columns in the data to be copied (denoted N
408                 below).
409
410         Int16[N]
411                 The format codes to be used for each column. Each must
412                 presently be zero (text) or one (binary). All must be zero
413                 if the overall copy format is textual.
414
415    CopyBothResponse (B) #
416
417         Byte1('W')
418                 Identifies the message as a Start Copy Both response. This
419                 message is used only for Streaming Replication.
420
421         Int32
422                 Length of message contents in bytes, including self.
423
424         Int8
425                 0 indicates the overall COPY format is textual (rows
426                 separated by newlines, columns separated by separator
427                 characters, etc.). 1 indicates the overall copy format is
428                 binary (similar to DataRow format). See COPY for more
429                 information.
430
431         Int16
432                 The number of columns in the data to be copied (denoted N
433                 below).
434
435         Int16[N]
436                 The format codes to be used for each column. Each must
437                 presently be zero (text) or one (binary). All must be zero
438                 if the overall copy format is textual.
439
440    DataRow (B) #
441
442         Byte1('D')
443                 Identifies the message as a data row.
444
445         Int32
446                 Length of message contents in bytes, including self.
447
448         Int16
449                 The number of column values that follow (possibly zero).
450
451           Next, the following pair of fields appear for each column:
452
453         Int32
454                 The length of the column value, in bytes (this count does
455                 not include itself). Can be zero. As a special case, -1
456                 indicates a NULL column value. No value bytes follow in
457                 the NULL case.
458
459         Byten
460                 The value of the column, in the format indicated by the
461                 associated format code. n is the above length.
462
463    Describe (F) #
464
465         Byte1('D')
466                 Identifies the message as a Describe command.
467
468         Int32
469                 Length of message contents in bytes, including self.
470
471         Byte1
472                 'S' to describe a prepared statement; or 'P' to describe a
473                 portal.
474
475         String
476                 The name of the prepared statement or portal to describe
477                 (an empty string selects the unnamed prepared statement or
478                 portal).
479
480    EmptyQueryResponse (B) #
481
482         Byte1('I')
483                 Identifies the message as a response to an empty query
484                 string. (This substitutes for CommandComplete.)
485
486         Int32(4)
487                 Length of message contents in bytes, including self.
488
489    ErrorResponse (B) #
490
491         Byte1('E')
492                 Identifies the message as an error.
493
494         Int32
495                 Length of message contents in bytes, including self.
496
497           The message body consists of one or more identified fields,
498           followed by a zero byte as a terminator. Fields can appear in
499           any order. For each field there is the following:
500
501         Byte1
502                 A code identifying the field type; if zero, this is the
503                 message terminator and no string follows. The presently
504                 defined field types are listed in Section 54.8. Since more
505                 field types might be added in future, frontends should
506                 silently ignore fields of unrecognized type.
507
508         String
509                 The field value.
510
511    Execute (F) #
512
513         Byte1('E')
514                 Identifies the message as an Execute command.
515
516         Int32
517                 Length of message contents in bytes, including self.
518
519         String
520                 The name of the portal to execute (an empty string selects
521                 the unnamed portal).
522
523         Int32
524                 Maximum number of rows to return, if portal contains a
525                 query that returns rows (ignored otherwise). Zero denotes
526                 “no limit”.
527
528    Flush (F) #
529
530         Byte1('H')
531                 Identifies the message as a Flush command.
532
533         Int32(4)
534                 Length of message contents in bytes, including self.
535
536    FunctionCall (F) #
537
538         Byte1('F')
539                 Identifies the message as a function call.
540
541         Int32
542                 Length of message contents in bytes, including self.
543
544         Int32
545                 Specifies the object ID of the function to call.
546
547         Int16
548                 The number of argument format codes that follow (denoted C
549                 below). This can be zero to indicate that there are no
550                 arguments or that the arguments all use the default format
551                 (text); or one, in which case the specified format code is
552                 applied to all arguments; or it can equal the actual
553                 number of arguments.
554
555         Int16[C]
556                 The argument format codes. Each must presently be zero
557                 (text) or one (binary).
558
559         Int16
560                 Specifies the number of arguments being supplied to the
561                 function.
562
563           Next, the following pair of fields appear for each argument:
564
565         Int32
566                 The length of the argument value, in bytes (this count
567                 does not include itself). Can be zero. As a special case,
568                 -1 indicates a NULL argument value. No value bytes follow
569                 in the NULL case.
570
571         Byten
572                 The value of the argument, in the format indicated by the
573                 associated format code. n is the above length.
574
575           After the last argument, the following field appears:
576
577         Int16
578                 The format code for the function result. Must presently be
579                 zero (text) or one (binary).
580
581    FunctionCallResponse (B) #
582
583         Byte1('V')
584                 Identifies the message as a function call result.
585
586         Int32
587                 Length of message contents in bytes, including self.
588
589         Int32
590                 The length of the function result value, in bytes (this
591                 count does not include itself). Can be zero. As a special
592                 case, -1 indicates a NULL function result. No value bytes
593                 follow in the NULL case.
594
595         Byten
596                 The value of the function result, in the format indicated
597                 by the associated format code. n is the above length.
598
599    GSSENCRequest (F) #
600
601         Int32(8)
602                 Length of message contents in bytes, including self.
603
604         Int32(80877104)
605                 The GSSAPI Encryption request code. The value is chosen to
606                 contain 1234 in the most significant 16 bits, and 5680 in
607                 the least significant 16 bits. (To avoid confusion, this
608                 code must not be the same as any protocol version number.)
609
610    GSSResponse (F) #
611
612         Byte1('p')
613                 Identifies the message as a GSSAPI or SSPI response. Note
614                 that this is also used for SASL and password response
615                 messages. The exact message type can be deduced from the
616                 context.
617
618         Int32
619                 Length of message contents in bytes, including self.
620
621         Byten
622                 GSSAPI/SSPI specific message data.
623
624    NegotiateProtocolVersion (B) #
625
626         Byte1('v')
627                 Identifies the message as a protocol version negotiation
628                 message.
629
630         Int32
631                 Length of message contents in bytes, including self.
632
633         Int32
634                 Newest minor protocol version supported by the server for
635                 the major protocol version requested by the client.
636
637         Int32
638                 Number of protocol options not recognized by the server.
639
640           Then, for protocol option not recognized by the server, there is
641           the following:
642
643         String
644                 The option name.
645
646    NoData (B) #
647
648         Byte1('n')
649                 Identifies the message as a no-data indicator.
650
651         Int32(4)
652                 Length of message contents in bytes, including self.
653
654    NoticeResponse (B) #
655
656         Byte1('N')
657                 Identifies the message as a notice.
658
659         Int32
660                 Length of message contents in bytes, including self.
661
662           The message body consists of one or more identified fields,
663           followed by a zero byte as a terminator. Fields can appear in
664           any order. For each field there is the following:
665
666         Byte1
667                 A code identifying the field type; if zero, this is the
668                 message terminator and no string follows. The presently
669                 defined field types are listed in Section 54.8. Since more
670                 field types might be added in future, frontends should
671                 silently ignore fields of unrecognized type.
672
673         String
674                 The field value.
675
676    NotificationResponse (B) #
677
678         Byte1('A')
679                 Identifies the message as a notification response.
680
681         Int32
682                 Length of message contents in bytes, including self.
683
684         Int32
685                 The process ID of the notifying backend process.
686
687         String
688                 The name of the channel that the notify has been raised
689                 on.
690
691         String
692                 The “payload” string passed from the notifying process.
693
694    ParameterDescription (B) #
695
696         Byte1('t')
697                 Identifies the message as a parameter description.
698
699         Int32
700                 Length of message contents in bytes, including self.
701
702         Int16
703                 The number of parameters used by the statement (can be
704                 zero).
705
706           Then, for each parameter, there is the following:
707
708         Int32
709                 Specifies the object ID of the parameter data type.
710
711    ParameterStatus (B) #
712
713         Byte1('S')
714                 Identifies the message as a run-time parameter status
715                 report.
716
717         Int32
718                 Length of message contents in bytes, including self.
719
720         String
721                 The name of the run-time parameter being reported.
722
723         String
724                 The current value of the parameter.
725
726    Parse (F) #
727
728         Byte1('P')
729                 Identifies the message as a Parse command.
730
731         Int32
732                 Length of message contents in bytes, including self.
733
734         String
735                 The name of the destination prepared statement (an empty
736                 string selects the unnamed prepared statement).
737
738         String
739                 The query string to be parsed.
740
741         Int16
742                 The number of parameter data types specified (can be
743                 zero). Note that this is not an indication of the number
744                 of parameters that might appear in the query string, only
745                 the number that the frontend wants to prespecify types
746                 for.
747
748           Then, for each parameter, there is the following:
749
750         Int32
751                 Specifies the object ID of the parameter data type.
752                 Placing a zero here is equivalent to leaving the type
753                 unspecified.
754
755    ParseComplete (B) #
756
757         Byte1('1')
758                 Identifies the message as a Parse-complete indicator.
759
760         Int32(4)
761                 Length of message contents in bytes, including self.
762
763    PasswordMessage (F) #
764
765         Byte1('p')
766                 Identifies the message as a password response. Note that
767                 this is also used for GSSAPI, SSPI and SASL response
768                 messages. The exact message type can be deduced from the
769                 context.
770
771         Int32
772                 Length of message contents in bytes, including self.
773
774         String
775                 The password (encrypted, if requested).
776
777    PortalSuspended (B) #
778
779         Byte1('s')
780                 Identifies the message as a portal-suspended indicator.
781                 Note this only appears if an Execute message's row-count
782                 limit was reached.
783
784         Int32(4)
785                 Length of message contents in bytes, including self.
786
787    Query (F) #
788
789         Byte1('Q')
790                 Identifies the message as a simple query.
791
792         Int32
793                 Length of message contents in bytes, including self.
794
795         String
796                 The query string itself.
797
798    ReadyForQuery (B) #
799
800         Byte1('Z')
801                 Identifies the message type. ReadyForQuery is sent
802                 whenever the backend is ready for a new query cycle.
803
804         Int32(5)
805                 Length of message contents in bytes, including self.
806
807         Byte1
808                 Current backend transaction status indicator. Possible
809                 values are 'I' if idle (not in a transaction block); 'T'
810                 if in a transaction block; or 'E' if in a failed
811                 transaction block (queries will be rejected until block is
812                 ended).
813
814    RowDescription (B) #
815
816         Byte1('T')
817                 Identifies the message as a row description.
818
819         Int32
820                 Length of message contents in bytes, including self.
821
822         Int16
823                 Specifies the number of fields in a row (can be zero).
824
825           Then, for each field, there is the following:
826
827         String
828                 The field name.
829
830         Int32
831                 If the field can be identified as a column of a specific
832                 table, the object ID of the table; otherwise zero.
833
834         Int16
835                 If the field can be identified as a column of a specific
836                 table, the attribute number of the column; otherwise zero.
837
838         Int32
839                 The object ID of the field's data type.
840
841         Int16
842                 The data type size (see pg_type.typlen). Note that
843                 negative values denote variable-width types.
844
845         Int32
846                 The type modifier (see pg_attribute.atttypmod). The
847                 meaning of the modifier is type-specific.
848
849         Int16
850                 The format code being used for the field. Currently will
851                 be zero (text) or one (binary). In a RowDescription
852                 returned from the statement variant of Describe, the
853                 format code is not yet known and will always be zero.
854
855    SASLInitialResponse (F) #
856
857         Byte1('p')
858                 Identifies the message as an initial SASL response. Note
859                 that this is also used for GSSAPI, SSPI and password
860                 response messages. The exact message type is deduced from
861                 the context.
862
863         Int32
864                 Length of message contents in bytes, including self.
865
866         String
867                 Name of the SASL authentication mechanism that the client
868                 selected.
869
870         Int32
871                 Length of SASL mechanism specific "Initial Client
872                 Response" that follows, or -1 if there is no Initial
873                 Response.
874
875         Byten
876                 SASL mechanism specific "Initial Response".
877
878    SASLResponse (F) #
879
880         Byte1('p')
881                 Identifies the message as a SASL response. Note that this
882                 is also used for GSSAPI, SSPI and password response
883                 messages. The exact message type can be deduced from the
884                 context.
885
886         Int32
887                 Length of message contents in bytes, including self.
888
889         Byten
890                 SASL mechanism specific message data.
891
892    SSLRequest (F) #
893
894         Int32(8)
895                 Length of message contents in bytes, including self.
896
897         Int32(80877103)
898                 The SSL request code. The value is chosen to contain 1234
899                 in the most significant 16 bits, and 5679 in the least
900                 significant 16 bits. (To avoid confusion, this code must
901                 not be the same as any protocol version number.)
902
903    StartupMessage (F) #
904
905         Int32
906                 Length of message contents in bytes, including self.
907
908         Int32(196610)
909                 The protocol version number. The most significant 16 bits
910                 are the major version number (3 for the protocol described
911                 here). The least significant 16 bits are the minor version
912                 number (2 for the protocol described here).
913
914           The protocol version number is followed by one or more pairs of
915           parameter name and value strings. A zero byte is required as a
916           terminator after the last name/value pair. Parameters can appear
917           in any order. user is required, others are optional. Each
918           parameter is specified as:
919
920         String
921                 The parameter name. Currently recognized names are:
922
923               user
924                       The database user name to connect as. Required;
925                       there is no default.
926
927               database
928                       The database to connect to. Defaults to the user
929                       name.
930
931               options
932                       Command-line arguments for the backend. (This is
933                       deprecated in favor of setting individual run-time
934                       parameters.) Spaces within this string are
935                       considered to separate arguments, unless escaped
936                       with a backslash (\); write \\ to represent a
937                       literal backslash.
938
939               replication
940                       Used to connect in streaming replication mode, where
941                       a small set of replication commands can be issued
942                       instead of SQL statements. Value can be true, false,
943                       or database, and the default is false. See
944                       Section 54.4 for details.
945
946                 In addition to the above, other parameters may be listed.
947                 Parameter names beginning with _pq_. are reserved for use
948                 as protocol extensions, while others are treated as
949                 run-time parameters to be set at backend start time. Such
950                 settings will be applied during backend start (after
951                 parsing the command-line arguments if any) and will act as
952                 session defaults.
953
954         String
955                 The parameter value.
956
957    Sync (F) #
958
959         Byte1('S')
960                 Identifies the message as a Sync command.
961
962         Int32(4)
963                 Length of message contents in bytes, including self.
964
965    Terminate (F) #
966
967         Byte1('X')
968                 Identifies the message as a termination.
969
970         Int32(4)
971                 Length of message contents in bytes, including self.