1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>54.10. Summary of Changes since Protocol 2.0</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats" /><link rel="next" href="source.html" title="Chapter 55. PostgreSQL Coding Conventions" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">54.10. Summary of Changes since Protocol 2.0</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 54. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 54. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="source.html" title="Chapter 55. PostgreSQL Coding Conventions">Next</a></td></tr></table><hr /></div><div class="sect1" id="PROTOCOL-CHANGES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">54.10. Summary of Changes since Protocol 2.0 <a href="#PROTOCOL-CHANGES" class="id_link">#</a></h2></div></div></div><p>
3 This section provides a quick checklist of changes, for the benefit of
4 developers trying to update existing client libraries to protocol 3.0.
6 The initial startup packet uses a flexible list-of-strings format
7 instead of a fixed format. Notice that session default values for run-time
8 parameters can now be specified directly in the startup packet. (Actually,
9 you could do that before using the <code class="literal">options</code> field, but given the
10 limited width of <code class="literal">options</code> and the lack of any way to quote
11 whitespace in the values, it wasn't a very safe technique.)
13 All messages now have a length count immediately following the message type
14 byte (except for startup packets, which have no type byte). Also note that
15 PasswordMessage now has a type byte.
17 ErrorResponse and NoticeResponse ('<code class="literal">E</code>' and '<code class="literal">N</code>')
18 messages now contain multiple fields, from which the client code can
19 assemble an error message of the desired level of verbosity. Note that
20 individual fields will typically not end with a newline, whereas the single
21 string sent in the older protocol always did.
23 The ReadyForQuery ('<code class="literal">Z</code>') message includes a transaction status
26 The distinction between BinaryRow and DataRow message types is gone; the
27 single DataRow message type serves for returning data in all formats.
28 Note that the layout of DataRow has changed to make it easier to parse.
29 Also, the representation of binary values has changed: it is no longer
30 directly tied to the server's internal representation.
32 There is a new <span class="quote">“<span class="quote">extended query</span>”</span> sub-protocol, which adds the frontend
33 message types Parse, Bind, Execute, Describe, Close, Flush, and Sync, and the
34 backend message types ParseComplete, BindComplete, PortalSuspended,
35 ParameterDescription, NoData, and CloseComplete. Existing clients do not
36 have to concern themselves with this sub-protocol, but making use of it
37 might allow improvements in performance or functionality.
39 <code class="command">COPY</code> data is now encapsulated into CopyData and CopyDone messages. There
40 is a well-defined way to recover from errors during <code class="command">COPY</code>. The special
41 <span class="quote">“<span class="quote"><code class="literal">\.</code></span>”</span> last line is not needed anymore, and is not sent
42 during <code class="command">COPY OUT</code>.
43 (It is still recognized as a terminator during text-mode <code class="command">COPY
44 IN</code>, but not in CSV mode. The text-mode behavior is
45 deprecated and may eventually be removed.) Binary <code class="command">COPY</code> is supported.
46 The CopyInResponse and CopyOutResponse messages include fields indicating
47 the number of columns and the format of each column.
49 The layout of FunctionCall and FunctionCallResponse messages has changed.
50 FunctionCall can now support passing NULL arguments to functions. It also
51 can handle passing parameters and retrieving results in either text or
52 binary format. There is no longer any reason to consider FunctionCall a
53 potential security hole, since it does not offer direct access to internal
54 server data representations.
56 The backend sends ParameterStatus ('<code class="literal">S</code>') messages during connection
57 startup for all parameters it considers interesting to the client library.
58 Subsequently, a ParameterStatus message is sent whenever the active value
59 changes for any of these parameters.
61 The RowDescription ('<code class="literal">T</code>') message carries new table OID and column
62 number fields for each column of the described row. It also shows the format
65 The CursorResponse ('<code class="literal">P</code>') message is no longer generated by
68 The NotificationResponse ('<code class="literal">A</code>') message has an additional string
69 field, which can carry a <span class="quote">“<span class="quote">payload</span>”</span> string passed
70 from the <code class="command">NOTIFY</code> event sender.
72 The EmptyQueryResponse ('<code class="literal">I</code>') message used to include an empty
73 string parameter; this has been removed.
74 </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html" title="Chapter 54. Frontend/Backend Protocol">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source.html" title="Chapter 55. PostgreSQL Coding Conventions">Next</a></td></tr><tr><td width="40%" align="left" valign="top">54.9. Logical Replication Message Formats </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Chapter 55. PostgreSQL Coding Conventions</td></tr></table></div></body></html>