gooderp18绿色标准版
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

73 lines
6.6KB

  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>52.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 V1.79.1" /><link rel="prev" href="protocol-logicalrep-message-formats.html" title="52.9. Logical Replication Message Formats" /><link rel="next" href="source.html" title="Chapter 53. PostgreSQL Coding Conventions" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">52.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="52.9. Logical Replication Message Formats">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 52. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 52. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="source.html" title="Chapter 53. PostgreSQL Coding Conventions">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="PROTOCOL-CHANGES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.10. Summary of Changes since Protocol 2.0</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.
  5. </p><p>
  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.)
  12. </p><p>
  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.
  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 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.
  22. </p><p>
  23. The ReadyForQuery ('<code class="literal">Z</code>') message includes a transaction status
  24. indicator.
  25. </p><p>
  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.
  31. </p><p>
  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.
  38. </p><p>
  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 <code class="command">COPY IN</code>, but its use is
  44. deprecated and will eventually be removed.) Binary <code class="command">COPY</code> is supported.
  45. The CopyInResponse and CopyOutResponse messages include fields indicating
  46. 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 also
  50. can handle passing parameters and retrieving results in either text or
  51. binary format. There is no longer any reason to consider FunctionCall a
  52. potential security hole, since it does not offer direct access to internal
  53. server data representations.
  54. </p><p>
  55. The backend sends ParameterStatus ('<code class="literal">S</code>') messages during connection
  56. startup for all parameters it considers interesting to the client library.
  57. Subsequently, a ParameterStatus message is sent whenever the active value
  58. changes for any of these parameters.
  59. </p><p>
  60. The RowDescription ('<code class="literal">T</code>') message carries new table OID and column
  61. number fields for each column of the described row. It also shows the format
  62. code for each column.
  63. </p><p>
  64. The CursorResponse ('<code class="literal">P</code>') message is no longer generated by
  65. the backend.
  66. </p><p>
  67. The NotificationResponse ('<code class="literal">A</code>') message has an additional string
  68. field, which can carry a <span class="quote">“<span class="quote">payload</span>”</span> string passed
  69. 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 empty
  72. 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">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">52.9. Logical Replication Message Formats </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 53. PostgreSQL Coding Conventions</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1