OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / doc / postgresql / html / protocol-changes.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Summary of Changes since Protocol 2.0</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REV="MADE"
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
11 REL="HOME"
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
14 REL="UP"
15 TITLE="Frontend/Backend Protocol"
16 HREF="protocol.html"><LINK
17 REL="PREVIOUS"
18 TITLE="Error and Notice Message Fields"
19 HREF="protocol-error-fields.html"><LINK
20 REL="NEXT"
21 TITLE="PostgreSQL Coding Conventions"
22 HREF="source.html"><LINK
23 REL="STYLESHEET"
24 TYPE="text/css"
25 HREF="stylesheet.css"><META
26 NAME="creation"
27 CONTENT="2003-12-22T03:48:47"></HEAD
28 ><BODY
29 CLASS="SECT1"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="5"
41 ALIGN="center"
42 VALIGN="bottom"
43 >PostgreSQL 7.4.1 Documentation</TH
44 ></TR
45 ><TR
46 ><TD
47 WIDTH="10%"
48 ALIGN="left"
49 VALIGN="top"
50 ><A
51 HREF="protocol-error-fields.html"
52 ACCESSKEY="P"
53 >Prev</A
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="left"
58 VALIGN="top"
59 ><A
60 HREF="protocol.html"
61 >Fast Backward</A
62 ></TD
63 ><TD
64 WIDTH="60%"
65 ALIGN="center"
66 VALIGN="bottom"
67 >Chapter 44. Frontend/Backend Protocol</TD
68 ><TD
69 WIDTH="10%"
70 ALIGN="right"
71 VALIGN="top"
72 ><A
73 HREF="protocol.html"
74 >Fast Forward</A
75 ></TD
76 ><TD
77 WIDTH="10%"
78 ALIGN="right"
79 VALIGN="top"
80 ><A
81 HREF="source.html"
82 ACCESSKEY="N"
83 >Next</A
84 ></TD
85 ></TR
86 ></TABLE
87 ><HR
88 ALIGN="LEFT"
89 WIDTH="100%"></DIV
90 ><DIV
91 CLASS="SECT1"
92 ><H1
93 CLASS="SECT1"
94 ><A
95 NAME="PROTOCOL-CHANGES"
96 >44.6. Summary of Changes since Protocol 2.0</A
97 ></H1
98 ><P
99 >This section provides a quick checklist of changes, for the benefit of
100 developers trying to update existing client libraries to protocol 3.0.</P
101 ><P
102 >The initial startup packet uses a flexible list-of-strings format
103 instead of a fixed format.  Notice that session default values for run-time
104 parameters can now be specified directly in the startup packet.  (Actually,
105 you could do that before using the <TT
106 CLASS="LITERAL"
107 >options</TT
108 > field, but given the
109 limited width of <TT
110 CLASS="LITERAL"
111 >options</TT
112 > and the lack of any way to quote
113 whitespace in the values, it wasn't a very safe technique.)</P
114 ><P
115 >All messages now have a length count immediately following the message type
116 byte (except for startup packets, which have no type byte).  Also note that
117 PasswordMessage now has a type byte.</P
118 ><P
119 >ErrorResponse and NoticeResponse ('<TT
120 CLASS="LITERAL"
121 >E</TT
122 >' and '<TT
123 CLASS="LITERAL"
124 >N</TT
125 >')
126 messages now contain multiple fields, from which the client code may
127 assemble an error message of the desired level of verbosity.  Note that
128 individual fields will typically not end with a newline, whereas the single
129 string sent in the older protocol always did.</P
130 ><P
131 >The ReadyForQuery ('<TT
132 CLASS="LITERAL"
133 >Z</TT
134 >') message includes a transaction status
135 indicator.</P
136 ><P
137 >The distinction between BinaryRow and DataRow message types is gone; the
138 single DataRow message type serves for returning data in all formats.
139 Note that the layout of DataRow has changed to make it easier to parse.
140 Also, the representation of binary values has changed: it is no longer
141 directly tied to the server's internal representation.</P
142 ><P
143 >There is a new <SPAN
144 CLASS="QUOTE"
145 >"extended query"</SPAN
146 > sub-protocol, which adds the frontend
147 message types Parse, Bind, Execute, Describe, Close, Flush, and Sync, and the
148 backend message types ParseComplete, BindComplete, PortalSuspended,
149 ParameterDescription, NoData, and CloseComplete.  Existing clients do not
150 have to concern themselves with this sub-protocol, but making use of it
151 may allow improvements in performance or functionality.</P
152 ><P
153 >COPY data is now encapsulated into CopyData and CopyDone messages.  There
154 is a well-defined way to recover from errors during COPY.  The special
155 <SPAN
156 CLASS="QUOTE"
157 >"<TT
158 CLASS="LITERAL"
159 >\.</TT
160 >"</SPAN
161 > last line is not needed anymore, and is not sent
162 during COPY OUT.
163 (It is still recognized as a terminator during COPY IN, but its use is
164 deprecated and will eventually be removed.)  Binary COPY is supported.
165 The CopyInResponse and CopyOutResponse messages include fields indicating
166 the number of columns and the format of each column.</P
167 ><P
168 >The layout of FunctionCall and FunctionCallResponse messages has changed.
169 FunctionCall can now support passing NULL arguments to functions.  It also
170 can handle passing parameters and retrieving results in either text or
171 binary format.  There is no longer any reason to consider FunctionCall a
172 potential security hole, since it does not offer direct access to internal
173 server data representations.</P
174 ><P
175 >The backend sends ParameterStatus ('<TT
176 CLASS="LITERAL"
177 >S</TT
178 >') messages during connection
179 startup for all parameters it considers interesting to the client library.
180 Subsequently, a ParameterStatus message is sent whenever the active value
181 changes for any of these parameters.</P
182 ><P
183 >The RowDescription ('<TT
184 CLASS="LITERAL"
185 >T</TT
186 >') message carries new table OID and column
187 number fields for each column of the described row.  It also shows the format
188 code for each column.</P
189 ><P
190 >The CursorResponse ('<TT
191 CLASS="LITERAL"
192 >P</TT
193 >') message is no longer generated by
194 the backend.</P
195 ><P
196 >The NotificationResponse ('<TT
197 CLASS="LITERAL"
198 >A</TT
199 >') message has an additional string
200 field, which is presently empty but may someday carry additional data passed
201 from the NOTIFY event sender.</P
202 ><P
203 >The EmptyQueryResponse ('<TT
204 CLASS="LITERAL"
205 >I</TT
206 >') message used to include an empty
207 string parameter; this has been removed.</P
208 ></DIV
209 ><DIV
210 CLASS="NAVFOOTER"
211 ><HR
212 ALIGN="LEFT"
213 WIDTH="100%"><TABLE
214 SUMMARY="Footer navigation table"
215 WIDTH="100%"
216 BORDER="0"
217 CELLPADDING="0"
218 CELLSPACING="0"
219 ><TR
220 ><TD
221 WIDTH="33%"
222 ALIGN="left"
223 VALIGN="top"
224 ><A
225 HREF="protocol-error-fields.html"
226 ACCESSKEY="P"
227 >Prev</A
228 ></TD
229 ><TD
230 WIDTH="34%"
231 ALIGN="center"
232 VALIGN="top"
233 ><A
234 HREF="index.html"
235 ACCESSKEY="H"
236 >Home</A
237 ></TD
238 ><TD
239 WIDTH="33%"
240 ALIGN="right"
241 VALIGN="top"
242 ><A
243 HREF="source.html"
244 ACCESSKEY="N"
245 >Next</A
246 ></TD
247 ></TR
248 ><TR
249 ><TD
250 WIDTH="33%"
251 ALIGN="left"
252 VALIGN="top"
253 >Error and Notice Message Fields</TD
254 ><TD
255 WIDTH="34%"
256 ALIGN="center"
257 VALIGN="top"
258 ><A
259 HREF="protocol.html"
260 ACCESSKEY="U"
261 >Up</A
262 ></TD
263 ><TD
264 WIDTH="33%"
265 ALIGN="right"
266 VALIGN="top"
267 >PostgreSQL Coding Conventions</TD
268 ></TR
269 ></TABLE
270 ></DIV
271 ></BODY
272 ></HTML
273 >