codekingpro/portable-devtools
115k
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>55.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="55.9. Logical Replication Message Formats" /><link rel="next" href="source.html" title="Chapter 56. 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">55.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="55.9. Logical Replication Message Formats">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 55. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="source.html" title="Chapter 56. 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">55.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 of4 developers trying to update existing client libraries to protocol 3.0.5 </p><p>6 The initial startup packet uses a flexible list-of-strings format7 instead of a fixed format. Notice that session default values for run-time8 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 the10 limited width of <code class="literal">options</code> and the lack of any way to quote11 whitespace in the values, it wasn't a very safe technique.)12 </p><p>13 All messages now have a length count immediately following the message type14 byte (except for startup packets, which have no type byte). Also note that15 PasswordMessage now has a type byte.16 </p><p>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 can19 assemble an error message of the desired level of verbosity. Note that20 individual fields will typically not end with a newline, whereas the single21 string sent in the older protocol always did.22 </p><p>23 The ReadyForQuery ('<code class="literal">Z</code>') message includes a transaction status24 indicator.25 </p><p>26 The distinction between BinaryRow and DataRow message types is gone; the27 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 longer30 directly tied to the server's internal representation.31 </p><p>32 There is a new <span class="quote">“<span class="quote">extended query</span>”</span> sub-protocol, which adds the frontend33 message types Parse, Bind, Execute, Describe, Close, Flush, and Sync, and the34 backend message types ParseComplete, BindComplete, PortalSuspended,35 ParameterDescription, NoData, and CloseComplete. Existing clients do not36 have to concern themselves with this sub-protocol, but making use of it37 might allow improvements in performance or functionality.38 </p><p>39 <code class="command">COPY</code> data is now encapsulated into CopyData and CopyDone messages. There40 is a well-defined way to recover from errors during <code class="command">COPY</code>. The special41 <span class="quote">“<span class="quote"><code class="literal">\.</code></span>”</span> last line is not needed anymore, and is not sent42 during <code class="command">COPY OUT</code>.43 (It is still recognized as a terminator during <code class="command">COPY IN</code>, but its use is44 deprecated and will eventually be removed.) Binary <code class="command">COPY</code> is supported.45 The CopyInResponse and CopyOutResponse messages include fields indicating46 the number of columns and the format of each column.47 </p><p>48 The layout of FunctionCall and FunctionCallResponse messages has changed.49 FunctionCall can now support passing NULL arguments to functions. It also50 can handle passing parameters and retrieving results in either text or51 binary format. There is no longer any reason to consider FunctionCall a52 potential security hole, since it does not offer direct access to internal53 server data representations.54 </p><p>55 The backend sends ParameterStatus ('<code class="literal">S</code>') messages during connection56 startup for all parameters it considers interesting to the client library.57 Subsequently, a ParameterStatus message is sent whenever the active value58 changes for any of these parameters.59 </p><p>60 The RowDescription ('<code class="literal">T</code>') message carries new table OID and column61 number fields for each column of the described row. It also shows the format62 code for each column.63 </p><p>64 The CursorResponse ('<code class="literal">P</code>') message is no longer generated by65 the backend.66 </p><p>67 The NotificationResponse ('<code class="literal">A</code>') message has an additional string68 field, which can carry a <span class="quote">“<span class="quote">payload</span>”</span> string passed69 from the <code class="command">NOTIFY</code> event sender.70 </p><p>71 The EmptyQueryResponse ('<code class="literal">I</code>') message used to include an empty72 string parameter; this has been removed.73 </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="55.9. Logical Replication Message Formats">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source.html" title="Chapter 56. PostgreSQL Coding Conventions">Next</a></td></tr><tr><td width="40%" align="left" valign="top">55.9. Logical Replication Message Formats </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Chapter 56. PostgreSQL Coding Conventions</td></tr></table></div></body></html>