gooderp18绿色标准版
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1380 linhas
55KB

  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.7. Message Formats</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-message-types.html" title="52.6. Message Data Types" /><link rel="next" href="protocol-error-fields.html" title="52.8. Error and Notice Message Fields" /></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.7. Message Formats</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-message-types.html" title="52.6. Message Data Types">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="protocol-error-fields.html" title="52.8. Error and Notice Message Fields">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="PROTOCOL-MESSAGE-FORMATS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.7. Message Formats</h2></div></div></div><p>
  3. This section describes the detailed format of each message. Each is marked to
  4. indicate that it can be sent by a frontend (F), a backend (B), or both
  5. (F &amp; B).
  6. Notice that although each message includes a byte count at the beginning,
  7. the message format is defined so that the message end can be found without
  8. reference to the byte count. This aids validity checking. (The CopyData
  9. message is an exception, because it forms part of a data stream; the contents
  10. of any individual CopyData message cannot be interpretable on their own.)
  11. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  12. AuthenticationOk (B)
  13. </span></dt><dd><p>
  14. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  15. Byte1('R')
  16. </span></dt><dd><p>
  17. Identifies the message as an authentication request.
  18. </p></dd><dt><span class="term">
  19. Int32(8)
  20. </span></dt><dd><p>
  21. Length of message contents in bytes, including self.
  22. </p></dd><dt><span class="term">
  23. Int32(0)
  24. </span></dt><dd><p>
  25. Specifies that the authentication was successful.
  26. </p></dd></dl></div><p>
  27. </p></dd><dt><span class="term">
  28. AuthenticationKerberosV5 (B)
  29. </span></dt><dd><p>
  30. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  31. Byte1('R')
  32. </span></dt><dd><p>
  33. Identifies the message as an authentication request.
  34. </p></dd><dt><span class="term">
  35. Int32(8)
  36. </span></dt><dd><p>
  37. Length of message contents in bytes, including self.
  38. </p></dd><dt><span class="term">
  39. Int32(2)
  40. </span></dt><dd><p>
  41. Specifies that Kerberos V5 authentication is required.
  42. </p></dd></dl></div><p>
  43. </p></dd><dt><span class="term">
  44. AuthenticationCleartextPassword (B)
  45. </span></dt><dd><p>
  46. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  47. Byte1('R')
  48. </span></dt><dd><p>
  49. Identifies the message as an authentication request.
  50. </p></dd><dt><span class="term">
  51. Int32(8)
  52. </span></dt><dd><p>
  53. Length of message contents in bytes, including self.
  54. </p></dd><dt><span class="term">
  55. Int32(3)
  56. </span></dt><dd><p>
  57. Specifies that a clear-text password is required.
  58. </p></dd></dl></div><p>
  59. </p></dd><dt><span class="term">
  60. AuthenticationMD5Password (B)
  61. </span></dt><dd><p>
  62. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  63. Byte1('R')
  64. </span></dt><dd><p>
  65. Identifies the message as an authentication request.
  66. </p></dd><dt><span class="term">
  67. Int32(12)
  68. </span></dt><dd><p>
  69. Length of message contents in bytes, including self.
  70. </p></dd><dt><span class="term">
  71. Int32(5)
  72. </span></dt><dd><p>
  73. Specifies that an MD5-encrypted password is required.
  74. </p></dd><dt><span class="term">
  75. Byte4
  76. </span></dt><dd><p>
  77. The salt to use when encrypting the password.
  78. </p></dd></dl></div><p>
  79. </p></dd><dt><span class="term">
  80. AuthenticationSCMCredential (B)
  81. </span></dt><dd><p>
  82. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  83. Byte1('R')
  84. </span></dt><dd><p>
  85. Identifies the message as an authentication request.
  86. </p></dd><dt><span class="term">
  87. Int32(8)
  88. </span></dt><dd><p>
  89. Length of message contents in bytes, including self.
  90. </p></dd><dt><span class="term">
  91. Int32(6)
  92. </span></dt><dd><p>
  93. Specifies that an SCM credentials message is required.
  94. </p></dd></dl></div><p>
  95. </p></dd><dt><span class="term">
  96. AuthenticationGSS (B)
  97. </span></dt><dd><p>
  98. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  99. Byte1('R')
  100. </span></dt><dd><p>
  101. Identifies the message as an authentication request.
  102. </p></dd><dt><span class="term">
  103. Int32(8)
  104. </span></dt><dd><p>
  105. Length of message contents in bytes, including self.
  106. </p></dd><dt><span class="term">
  107. Int32(7)
  108. </span></dt><dd><p>
  109. Specifies that GSSAPI authentication is required.
  110. </p></dd></dl></div><p>
  111. </p></dd><dt><span class="term">
  112. AuthenticationSSPI (B)
  113. </span></dt><dd><p>
  114. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  115. Byte1('R')
  116. </span></dt><dd><p>
  117. Identifies the message as an authentication request.
  118. </p></dd><dt><span class="term">
  119. Int32(8)
  120. </span></dt><dd><p>
  121. Length of message contents in bytes, including self.
  122. </p></dd><dt><span class="term">
  123. Int32(9)
  124. </span></dt><dd><p>
  125. Specifies that SSPI authentication is required.
  126. </p></dd></dl></div><p>
  127. </p></dd><dt><span class="term">
  128. AuthenticationGSSContinue (B)
  129. </span></dt><dd><p>
  130. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  131. Byte1('R')
  132. </span></dt><dd><p>
  133. Identifies the message as an authentication request.
  134. </p></dd><dt><span class="term">
  135. Int32
  136. </span></dt><dd><p>
  137. Length of message contents in bytes, including self.
  138. </p></dd><dt><span class="term">
  139. Int32(8)
  140. </span></dt><dd><p>
  141. Specifies that this message contains GSSAPI or SSPI data.
  142. </p></dd><dt><span class="term">
  143. Byte<em class="replaceable"><code>n</code></em>
  144. </span></dt><dd><p>
  145. GSSAPI or SSPI authentication data.
  146. </p></dd></dl></div><p>
  147. </p></dd><dt><span class="term">
  148. AuthenticationSASL (B)
  149. </span></dt><dd><p>
  150. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  151. Byte1('R')
  152. </span></dt><dd><p>
  153. Identifies the message as an authentication request.
  154. </p></dd><dt><span class="term">
  155. Int32
  156. </span></dt><dd><p>
  157. Length of message contents in bytes, including self.
  158. </p></dd><dt><span class="term">
  159. Int32(10)
  160. </span></dt><dd><p>
  161. Specifies that SASL authentication is required.
  162. </p></dd></dl></div><p>
  163. The message body is a list of SASL authentication mechanisms, in the
  164. server's order of preference. A zero byte is required as terminator after
  165. the last authentication mechanism name. For each mechanism, there is the
  166. following:
  167. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  168. String
  169. </span></dt><dd><p>
  170. Name of a SASL authentication mechanism.
  171. </p></dd></dl></div><p>
  172. </p></dd><dt><span class="term">
  173. AuthenticationSASLContinue (B)
  174. </span></dt><dd><p>
  175. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  176. Byte1('R')
  177. </span></dt><dd><p>
  178. Identifies the message as an authentication request.
  179. </p></dd><dt><span class="term">
  180. Int32
  181. </span></dt><dd><p>
  182. Length of message contents in bytes, including self.
  183. </p></dd><dt><span class="term">
  184. Int32(11)
  185. </span></dt><dd><p>
  186. Specifies that this message contains a SASL challenge.
  187. </p></dd><dt><span class="term">
  188. Byte<em class="replaceable"><code>n</code></em>
  189. </span></dt><dd><p>
  190. SASL data, specific to the SASL mechanism being used.
  191. </p></dd></dl></div><p>
  192. </p></dd><dt><span class="term">
  193. AuthenticationSASLFinal (B)
  194. </span></dt><dd><p>
  195. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  196. Byte1('R')
  197. </span></dt><dd><p>
  198. Identifies the message as an authentication request.
  199. </p></dd><dt><span class="term">
  200. Int32
  201. </span></dt><dd><p>
  202. Length of message contents in bytes, including self.
  203. </p></dd><dt><span class="term">
  204. Int32(12)
  205. </span></dt><dd><p>
  206. Specifies that SASL authentication has completed.
  207. </p></dd><dt><span class="term">
  208. Byte<em class="replaceable"><code>n</code></em>
  209. </span></dt><dd><p>
  210. SASL outcome "additional data", specific to the SASL mechanism
  211. being used.
  212. </p></dd></dl></div><p>
  213. </p></dd><dt><span class="term">
  214. BackendKeyData (B)
  215. </span></dt><dd><p>
  216. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  217. Byte1('K')
  218. </span></dt><dd><p>
  219. Identifies the message as cancellation key data.
  220. The frontend must save these values if it wishes to be
  221. able to issue CancelRequest messages later.
  222. </p></dd><dt><span class="term">
  223. Int32(12)
  224. </span></dt><dd><p>
  225. Length of message contents in bytes, including self.
  226. </p></dd><dt><span class="term">
  227. Int32
  228. </span></dt><dd><p>
  229. The process ID of this backend.
  230. </p></dd><dt><span class="term">
  231. Int32
  232. </span></dt><dd><p>
  233. The secret key of this backend.
  234. </p></dd></dl></div><p>
  235. </p></dd><dt><span class="term">
  236. Bind (F)
  237. </span></dt><dd><p>
  238. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  239. Byte1('B')
  240. </span></dt><dd><p>
  241. Identifies the message as a Bind command.
  242. </p></dd><dt><span class="term">
  243. Int32
  244. </span></dt><dd><p>
  245. Length of message contents in bytes, including self.
  246. </p></dd><dt><span class="term">
  247. String
  248. </span></dt><dd><p>
  249. The name of the destination portal
  250. (an empty string selects the unnamed portal).
  251. </p></dd><dt><span class="term">
  252. String
  253. </span></dt><dd><p>
  254. The name of the source prepared statement
  255. (an empty string selects the unnamed prepared statement).
  256. </p></dd><dt><span class="term">
  257. Int16
  258. </span></dt><dd><p>
  259. The number of parameter format codes that follow
  260. (denoted <em class="replaceable"><code>C</code></em> below).
  261. This can be zero to indicate that there are no parameters
  262. or that the parameters all use the default format (text);
  263. or one, in which case the specified format code is applied
  264. to all parameters; or it can equal the actual number of
  265. parameters.
  266. </p></dd><dt><span class="term">
  267. Int16[<em class="replaceable"><code>C</code></em>]
  268. </span></dt><dd><p>
  269. The parameter format codes. Each must presently be
  270. zero (text) or one (binary).
  271. </p></dd><dt><span class="term">
  272. Int16
  273. </span></dt><dd><p>
  274. The number of parameter values that follow (possibly zero).
  275. This must match the number of parameters needed by the query.
  276. </p></dd></dl></div><p>
  277. Next, the following pair of fields appear for each parameter:
  278. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  279. Int32
  280. </span></dt><dd><p>
  281. The length of the parameter value, in bytes (this count
  282. does not include itself). Can be zero.
  283. As a special case, -1 indicates a NULL parameter value.
  284. No value bytes follow in the NULL case.
  285. </p></dd><dt><span class="term">
  286. Byte<em class="replaceable"><code>n</code></em>
  287. </span></dt><dd><p>
  288. The value of the parameter, in the format indicated by the
  289. associated format code.
  290. <em class="replaceable"><code>n</code></em> is the above length.
  291. </p></dd></dl></div><p>
  292. After the last parameter, the following fields appear:
  293. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  294. Int16
  295. </span></dt><dd><p>
  296. The number of result-column format codes that follow
  297. (denoted <em class="replaceable"><code>R</code></em> below).
  298. This can be zero to indicate that there are no result columns
  299. or that the result columns should all use the default format
  300. (text);
  301. or one, in which case the specified format code is applied
  302. to all result columns (if any); or it can equal the actual
  303. number of result columns of the query.
  304. </p></dd><dt><span class="term">
  305. Int16[<em class="replaceable"><code>R</code></em>]
  306. </span></dt><dd><p>
  307. The result-column format codes. Each must presently be
  308. zero (text) or one (binary).
  309. </p></dd></dl></div><p>
  310. </p></dd><dt><span class="term">
  311. BindComplete (B)
  312. </span></dt><dd><p>
  313. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  314. Byte1('2')
  315. </span></dt><dd><p>
  316. Identifies the message as a Bind-complete indicator.
  317. </p></dd><dt><span class="term">
  318. Int32(4)
  319. </span></dt><dd><p>
  320. Length of message contents in bytes, including self.
  321. </p></dd></dl></div><p>
  322. </p></dd><dt><span class="term">
  323. CancelRequest (F)
  324. </span></dt><dd><p>
  325. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  326. Int32(16)
  327. </span></dt><dd><p>
  328. Length of message contents in bytes, including self.
  329. </p></dd><dt><span class="term">
  330. Int32(80877102)
  331. </span></dt><dd><p>
  332. The cancel request code. The value is chosen to contain
  333. <code class="literal">1234</code> in the most significant 16 bits, and <code class="literal">5678</code> in the
  334. least significant 16 bits. (To avoid confusion, this code
  335. must not be the same as any protocol version number.)
  336. </p></dd><dt><span class="term">
  337. Int32
  338. </span></dt><dd><p>
  339. The process ID of the target backend.
  340. </p></dd><dt><span class="term">
  341. Int32
  342. </span></dt><dd><p>
  343. The secret key for the target backend.
  344. </p></dd></dl></div><p>
  345. </p></dd><dt><span class="term">
  346. Close (F)
  347. </span></dt><dd><p>
  348. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  349. Byte1('C')
  350. </span></dt><dd><p>
  351. Identifies the message as a Close command.
  352. </p></dd><dt><span class="term">
  353. Int32
  354. </span></dt><dd><p>
  355. Length of message contents in bytes, including self.
  356. </p></dd><dt><span class="term">
  357. Byte1
  358. </span></dt><dd><p>
  359. '<code class="literal">S</code>' to close a prepared statement; or
  360. '<code class="literal">P</code>' to close a portal.
  361. </p></dd><dt><span class="term">
  362. String
  363. </span></dt><dd><p>
  364. The name of the prepared statement or portal to close
  365. (an empty string selects the unnamed prepared statement
  366. or portal).
  367. </p></dd></dl></div><p>
  368. </p></dd><dt><span class="term">
  369. CloseComplete (B)
  370. </span></dt><dd><p>
  371. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  372. Byte1('3')
  373. </span></dt><dd><p>
  374. Identifies the message as a Close-complete indicator.
  375. </p></dd><dt><span class="term">
  376. Int32(4)
  377. </span></dt><dd><p>
  378. Length of message contents in bytes, including self.
  379. </p></dd></dl></div><p>
  380. </p></dd><dt><span class="term">
  381. CommandComplete (B)
  382. </span></dt><dd><p>
  383. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  384. Byte1('C')
  385. </span></dt><dd><p>
  386. Identifies the message as a command-completed response.
  387. </p></dd><dt><span class="term">
  388. Int32
  389. </span></dt><dd><p>
  390. Length of message contents in bytes, including self.
  391. </p></dd><dt><span class="term">
  392. String
  393. </span></dt><dd><p>
  394. The command tag. This is usually a single
  395. word that identifies which SQL command was completed.
  396. </p><p>
  397. For an <code class="command">INSERT</code> command, the tag is
  398. <code class="literal">INSERT <em class="replaceable"><code>oid</code></em>
  399. <em class="replaceable"><code>rows</code></em></code>, where
  400. <em class="replaceable"><code>rows</code></em> is the number of rows
  401. inserted. <em class="replaceable"><code>oid</code></em> used to be the object ID
  402. of the inserted row if <em class="replaceable"><code>rows</code></em> was 1
  403. and the target table had OIDs, but OIDs system columns are
  404. not supported anymore; therefore <em class="replaceable"><code>oid</code></em>
  405. is always 0.
  406. </p><p>
  407. For a <code class="command">DELETE</code> command, the tag is
  408. <code class="literal">DELETE <em class="replaceable"><code>rows</code></em></code> where
  409. <em class="replaceable"><code>rows</code></em> is the number of rows deleted.
  410. </p><p>
  411. For an <code class="command">UPDATE</code> command, the tag is
  412. <code class="literal">UPDATE <em class="replaceable"><code>rows</code></em></code> where
  413. <em class="replaceable"><code>rows</code></em> is the number of rows updated.
  414. </p><p>
  415. For a <code class="command">SELECT</code> or <code class="command">CREATE TABLE AS</code>
  416. command, the tag is <code class="literal">SELECT <em class="replaceable"><code>rows</code></em></code>
  417. where <em class="replaceable"><code>rows</code></em> is the number of rows retrieved.
  418. </p><p>
  419. For a <code class="command">MOVE</code> command, the tag is
  420. <code class="literal">MOVE <em class="replaceable"><code>rows</code></em></code> where
  421. <em class="replaceable"><code>rows</code></em> is the number of rows the
  422. cursor's position has been changed by.
  423. </p><p>
  424. For a <code class="command">FETCH</code> command, the tag is
  425. <code class="literal">FETCH <em class="replaceable"><code>rows</code></em></code> where
  426. <em class="replaceable"><code>rows</code></em> is the number of rows that
  427. have been retrieved from the cursor.
  428. </p><p>
  429. For a <code class="command">COPY</code> command, the tag is
  430. <code class="literal">COPY <em class="replaceable"><code>rows</code></em></code> where
  431. <em class="replaceable"><code>rows</code></em> is the number of rows copied.
  432. (Note: the row count appears only in
  433. <span class="productname">PostgreSQL</span> 8.2 and later.)
  434. </p></dd></dl></div><p>
  435. </p></dd><dt><span class="term">
  436. CopyData (F &amp; B)
  437. </span></dt><dd><p>
  438. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  439. Byte1('d')
  440. </span></dt><dd><p>
  441. Identifies the message as <code class="command">COPY</code> data.
  442. </p></dd><dt><span class="term">
  443. Int32
  444. </span></dt><dd><p>
  445. Length of message contents in bytes, including self.
  446. </p></dd><dt><span class="term">
  447. Byte<em class="replaceable"><code>n</code></em>
  448. </span></dt><dd><p>
  449. Data that forms part of a <code class="command">COPY</code> data stream. Messages sent
  450. from the backend will always correspond to single data rows,
  451. but messages sent by frontends might divide the data stream
  452. arbitrarily.
  453. </p></dd></dl></div><p>
  454. </p></dd><dt><span class="term">
  455. CopyDone (F &amp; B)
  456. </span></dt><dd><p>
  457. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  458. Byte1('c')
  459. </span></dt><dd><p>
  460. Identifies the message as a <code class="command">COPY</code>-complete indicator.
  461. </p></dd><dt><span class="term">
  462. Int32(4)
  463. </span></dt><dd><p>
  464. Length of message contents in bytes, including self.
  465. </p></dd></dl></div><p>
  466. </p></dd><dt><span class="term">
  467. CopyFail (F)
  468. </span></dt><dd><p>
  469. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  470. Byte1('f')
  471. </span></dt><dd><p>
  472. Identifies the message as a <code class="command">COPY</code>-failure indicator.
  473. </p></dd><dt><span class="term">
  474. Int32
  475. </span></dt><dd><p>
  476. Length of message contents in bytes, including self.
  477. </p></dd><dt><span class="term">
  478. String
  479. </span></dt><dd><p>
  480. An error message to report as the cause of failure.
  481. </p></dd></dl></div><p>
  482. </p></dd><dt><span class="term">
  483. CopyInResponse (B)
  484. </span></dt><dd><p>
  485. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  486. Byte1('G')
  487. </span></dt><dd><p>
  488. Identifies the message as a Start Copy In response.
  489. The frontend must now send copy-in data (if not
  490. prepared to do so, send a CopyFail message).
  491. </p></dd><dt><span class="term">
  492. Int32
  493. </span></dt><dd><p>
  494. Length of message contents in bytes, including self.
  495. </p></dd><dt><span class="term">
  496. Int8
  497. </span></dt><dd><p>
  498. 0 indicates the overall <code class="command">COPY</code> format is textual (rows
  499. separated by newlines, columns separated by separator
  500. characters, etc).
  501. 1 indicates the overall copy format is binary (similar
  502. to DataRow format).
  503. See <a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a>
  504. for more information.
  505. </p></dd><dt><span class="term">
  506. Int16
  507. </span></dt><dd><p>
  508. The number of columns in the data to be copied
  509. (denoted <em class="replaceable"><code>N</code></em> below).
  510. </p></dd><dt><span class="term">
  511. Int16[<em class="replaceable"><code>N</code></em>]
  512. </span></dt><dd><p>
  513. The format codes to be used for each column.
  514. Each must presently be zero (text) or one (binary).
  515. All must be zero if the overall copy format is textual.
  516. </p></dd></dl></div><p>
  517. </p></dd><dt><span class="term">
  518. CopyOutResponse (B)
  519. </span></dt><dd><p>
  520. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  521. Byte1('H')
  522. </span></dt><dd><p>
  523. Identifies the message as a Start Copy Out response.
  524. This message will be followed by copy-out data.
  525. </p></dd><dt><span class="term">
  526. Int32
  527. </span></dt><dd><p>
  528. Length of message contents in bytes, including self.
  529. </p></dd><dt><span class="term">
  530. Int8
  531. </span></dt><dd><p>
  532. 0 indicates the overall <code class="command">COPY</code> format
  533. is textual (rows separated by newlines, columns
  534. separated by separator characters, etc). 1 indicates
  535. the overall copy format is binary (similar to DataRow
  536. format). See <a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a> for more information.
  537. </p></dd><dt><span class="term">
  538. Int16
  539. </span></dt><dd><p>
  540. The number of columns in the data to be copied
  541. (denoted <em class="replaceable"><code>N</code></em> below).
  542. </p></dd><dt><span class="term">
  543. Int16[<em class="replaceable"><code>N</code></em>]
  544. </span></dt><dd><p>
  545. The format codes to be used for each column.
  546. Each must presently be zero (text) or one (binary).
  547. All must be zero if the overall copy format is textual.
  548. </p></dd></dl></div><p>
  549. </p></dd><dt><span class="term">
  550. CopyBothResponse (B)
  551. </span></dt><dd><p>
  552. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  553. Byte1('W')
  554. </span></dt><dd><p>
  555. Identifies the message as a Start Copy Both response.
  556. This message is used only for Streaming Replication.
  557. </p></dd><dt><span class="term">
  558. Int32
  559. </span></dt><dd><p>
  560. Length of message contents in bytes, including self.
  561. </p></dd><dt><span class="term">
  562. Int8
  563. </span></dt><dd><p>
  564. 0 indicates the overall <code class="command">COPY</code> format
  565. is textual (rows separated by newlines, columns
  566. separated by separator characters, etc). 1 indicates
  567. the overall copy format is binary (similar to DataRow
  568. format). See <a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a> for more information.
  569. </p></dd><dt><span class="term">
  570. Int16
  571. </span></dt><dd><p>
  572. The number of columns in the data to be copied
  573. (denoted <em class="replaceable"><code>N</code></em> below).
  574. </p></dd><dt><span class="term">
  575. Int16[<em class="replaceable"><code>N</code></em>]
  576. </span></dt><dd><p>
  577. The format codes to be used for each column.
  578. Each must presently be zero (text) or one (binary).
  579. All must be zero if the overall copy format is textual.
  580. </p></dd></dl></div><p>
  581. </p></dd><dt><span class="term">
  582. DataRow (B)
  583. </span></dt><dd><p>
  584. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  585. Byte1('D')
  586. </span></dt><dd><p>
  587. Identifies the message as a data row.
  588. </p></dd><dt><span class="term">
  589. Int32
  590. </span></dt><dd><p>
  591. Length of message contents in bytes, including self.
  592. </p></dd><dt><span class="term">
  593. Int16
  594. </span></dt><dd><p>
  595. The number of column values that follow (possibly zero).
  596. </p></dd></dl></div><p>
  597. Next, the following pair of fields appear for each column:
  598. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  599. Int32
  600. </span></dt><dd><p>
  601. The length of the column value, in bytes (this count
  602. does not include itself). Can be zero.
  603. As a special case, -1 indicates a NULL column value.
  604. No value bytes follow in the NULL case.
  605. </p></dd><dt><span class="term">
  606. Byte<em class="replaceable"><code>n</code></em>
  607. </span></dt><dd><p>
  608. The value of the column, in the format indicated by the
  609. associated format code.
  610. <em class="replaceable"><code>n</code></em> is the above length.
  611. </p></dd></dl></div><p>
  612. </p></dd><dt><span class="term">
  613. Describe (F)
  614. </span></dt><dd><p>
  615. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  616. Byte1('D')
  617. </span></dt><dd><p>
  618. Identifies the message as a Describe command.
  619. </p></dd><dt><span class="term">
  620. Int32
  621. </span></dt><dd><p>
  622. Length of message contents in bytes, including self.
  623. </p></dd><dt><span class="term">
  624. Byte1
  625. </span></dt><dd><p>
  626. '<code class="literal">S</code>' to describe a prepared statement; or
  627. '<code class="literal">P</code>' to describe a portal.
  628. </p></dd><dt><span class="term">
  629. String
  630. </span></dt><dd><p>
  631. The name of the prepared statement or portal to describe
  632. (an empty string selects the unnamed prepared statement
  633. or portal).
  634. </p></dd></dl></div><p>
  635. </p></dd><dt><span class="term">
  636. EmptyQueryResponse (B)
  637. </span></dt><dd><p>
  638. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  639. Byte1('I')
  640. </span></dt><dd><p>
  641. Identifies the message as a response to an empty query string.
  642. (This substitutes for CommandComplete.)
  643. </p></dd><dt><span class="term">
  644. Int32(4)
  645. </span></dt><dd><p>
  646. Length of message contents in bytes, including self.
  647. </p></dd></dl></div><p>
  648. </p></dd><dt><span class="term">
  649. ErrorResponse (B)
  650. </span></dt><dd><p>
  651. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  652. Byte1('E')
  653. </span></dt><dd><p>
  654. Identifies the message as an error.
  655. </p></dd><dt><span class="term">
  656. Int32
  657. </span></dt><dd><p>
  658. Length of message contents in bytes, including self.
  659. </p></dd></dl></div><p>
  660. The message body consists of one or more identified fields,
  661. followed by a zero byte as a terminator. Fields can appear in
  662. any order. For each field there is the following:
  663. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  664. Byte1
  665. </span></dt><dd><p>
  666. A code identifying the field type; if zero, this is
  667. the message terminator and no string follows.
  668. The presently defined field types are listed in
  669. <a class="xref" href="protocol-error-fields.html" title="52.8. Error and Notice Message Fields">Section 52.8</a>.
  670. Since more field types might be added in future,
  671. frontends should silently ignore fields of unrecognized
  672. type.
  673. </p></dd><dt><span class="term">
  674. String
  675. </span></dt><dd><p>
  676. The field value.
  677. </p></dd></dl></div><p>
  678. </p></dd><dt><span class="term">
  679. Execute (F)
  680. </span></dt><dd><p>
  681. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  682. Byte1('E')
  683. </span></dt><dd><p>
  684. Identifies the message as an Execute command.
  685. </p></dd><dt><span class="term">
  686. Int32
  687. </span></dt><dd><p>
  688. Length of message contents in bytes, including self.
  689. </p></dd><dt><span class="term">
  690. String
  691. </span></dt><dd><p>
  692. The name of the portal to execute
  693. (an empty string selects the unnamed portal).
  694. </p></dd><dt><span class="term">
  695. Int32
  696. </span></dt><dd><p>
  697. Maximum number of rows to return, if portal contains
  698. a query that returns rows (ignored otherwise). Zero
  699. denotes <span class="quote">“<span class="quote">no limit</span>”</span>.
  700. </p></dd></dl></div><p>
  701. </p></dd><dt><span class="term">
  702. Flush (F)
  703. </span></dt><dd><p>
  704. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  705. Byte1('H')
  706. </span></dt><dd><p>
  707. Identifies the message as a Flush command.
  708. </p></dd><dt><span class="term">
  709. Int32(4)
  710. </span></dt><dd><p>
  711. Length of message contents in bytes, including self.
  712. </p></dd></dl></div><p>
  713. </p></dd><dt><span class="term">
  714. FunctionCall (F)
  715. </span></dt><dd><p>
  716. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  717. Byte1('F')
  718. </span></dt><dd><p>
  719. Identifies the message as a function call.
  720. </p></dd><dt><span class="term">
  721. Int32
  722. </span></dt><dd><p>
  723. Length of message contents in bytes, including self.
  724. </p></dd><dt><span class="term">
  725. Int32
  726. </span></dt><dd><p>
  727. Specifies the object ID of the function to call.
  728. </p></dd><dt><span class="term">
  729. Int16
  730. </span></dt><dd><p>
  731. The number of argument format codes that follow
  732. (denoted <em class="replaceable"><code>C</code></em> below).
  733. This can be zero to indicate that there are no arguments
  734. or that the arguments all use the default format (text);
  735. or one, in which case the specified format code is applied
  736. to all arguments; or it can equal the actual number of
  737. arguments.
  738. </p></dd><dt><span class="term">
  739. Int16[<em class="replaceable"><code>C</code></em>]
  740. </span></dt><dd><p>
  741. The argument format codes. Each must presently be
  742. zero (text) or one (binary).
  743. </p></dd><dt><span class="term">
  744. Int16
  745. </span></dt><dd><p>
  746. Specifies the number of arguments being supplied to the
  747. function.
  748. </p></dd></dl></div><p>
  749. Next, the following pair of fields appear for each argument:
  750. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  751. Int32
  752. </span></dt><dd><p>
  753. The length of the argument value, in bytes (this count
  754. does not include itself). Can be zero.
  755. As a special case, -1 indicates a NULL argument value.
  756. No value bytes follow in the NULL case.
  757. </p></dd><dt><span class="term">
  758. Byte<em class="replaceable"><code>n</code></em>
  759. </span></dt><dd><p>
  760. The value of the argument, in the format indicated by the
  761. associated format code.
  762. <em class="replaceable"><code>n</code></em> is the above length.
  763. </p></dd></dl></div><p>
  764. After the last argument, the following field appears:
  765. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  766. Int16
  767. </span></dt><dd><p>
  768. The format code for the function result. Must presently be
  769. zero (text) or one (binary).
  770. </p></dd></dl></div><p>
  771. </p></dd><dt><span class="term">
  772. FunctionCallResponse (B)
  773. </span></dt><dd><p>
  774. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  775. Byte1('V')
  776. </span></dt><dd><p>
  777. Identifies the message as a function call result.
  778. </p></dd><dt><span class="term">
  779. Int32
  780. </span></dt><dd><p>
  781. Length of message contents in bytes, including self.
  782. </p></dd><dt><span class="term">
  783. Int32
  784. </span></dt><dd><p>
  785. The length of the function result value, in bytes (this count
  786. does not include itself). Can be zero.
  787. As a special case, -1 indicates a NULL function result.
  788. No value bytes follow in the NULL case.
  789. </p></dd><dt><span class="term">
  790. Byte<em class="replaceable"><code>n</code></em>
  791. </span></dt><dd><p>
  792. The value of the function result, in the format indicated by
  793. the associated format code.
  794. <em class="replaceable"><code>n</code></em> is the above length.
  795. </p></dd></dl></div><p>
  796. </p></dd><dt><span class="term">
  797. GSSResponse (F)
  798. </span></dt><dd><p>
  799. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  800. Byte1('p')
  801. </span></dt><dd><p>
  802. Identifies the message as a GSSAPI or SSPI response. Note that
  803. this is also used for SASL and password response messages.
  804. The exact message type can be deduced from the context.
  805. </p></dd><dt><span class="term">
  806. Int32
  807. </span></dt><dd><p>
  808. Length of message contents in bytes, including self.
  809. </p></dd><dt><span class="term">
  810. Byte<em class="replaceable"><code>n</code></em>
  811. </span></dt><dd><p>
  812. GSSAPI/SSPI specific message data.
  813. </p></dd></dl></div><p>
  814. </p></dd><dt><span class="term">
  815. NegotiateProtocolVersion (B)
  816. </span></dt><dd><p>
  817. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  818. Byte1('v')
  819. </span></dt><dd><p>
  820. Identifies the message as a protocol version negotiation
  821. message.
  822. </p></dd><dt><span class="term">
  823. Int32
  824. </span></dt><dd><p>
  825. Length of message contents in bytes, including self.
  826. </p></dd><dt><span class="term">
  827. Int32
  828. </span></dt><dd><p>
  829. Newest minor protocol version supported by the server
  830. for the major protocol version requested by the client.
  831. </p></dd><dt><span class="term">
  832. Int32
  833. </span></dt><dd><p>
  834. Number of protocol options not recognized by the server.
  835. </p></dd></dl></div><p>
  836. Then, for protocol option not recognized by the server, there
  837. is the following:
  838. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  839. String
  840. </span></dt><dd><p>
  841. The option name.
  842. </p></dd></dl></div><p>
  843. </p></dd><dt><span class="term">
  844. NoData (B)
  845. </span></dt><dd><p>
  846. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  847. Byte1('n')
  848. </span></dt><dd><p>
  849. Identifies the message as a no-data indicator.
  850. </p></dd><dt><span class="term">
  851. Int32(4)
  852. </span></dt><dd><p>
  853. Length of message contents in bytes, including self.
  854. </p></dd></dl></div><p>
  855. </p></dd><dt><span class="term">
  856. NoticeResponse (B)
  857. </span></dt><dd><p>
  858. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  859. Byte1('N')
  860. </span></dt><dd><p>
  861. Identifies the message as a notice.
  862. </p></dd><dt><span class="term">
  863. Int32
  864. </span></dt><dd><p>
  865. Length of message contents in bytes, including self.
  866. </p></dd></dl></div><p>
  867. The message body consists of one or more identified fields,
  868. followed by a zero byte as a terminator. Fields can appear in
  869. any order. For each field there is the following:
  870. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  871. Byte1
  872. </span></dt><dd><p>
  873. A code identifying the field type; if zero, this is
  874. the message terminator and no string follows.
  875. The presently defined field types are listed in
  876. <a class="xref" href="protocol-error-fields.html" title="52.8. Error and Notice Message Fields">Section 52.8</a>.
  877. Since more field types might be added in future,
  878. frontends should silently ignore fields of unrecognized
  879. type.
  880. </p></dd><dt><span class="term">
  881. String
  882. </span></dt><dd><p>
  883. The field value.
  884. </p></dd></dl></div><p>
  885. </p></dd><dt><span class="term">
  886. NotificationResponse (B)
  887. </span></dt><dd><p>
  888. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  889. Byte1('A')
  890. </span></dt><dd><p>
  891. Identifies the message as a notification response.
  892. </p></dd><dt><span class="term">
  893. Int32
  894. </span></dt><dd><p>
  895. Length of message contents in bytes, including self.
  896. </p></dd><dt><span class="term">
  897. Int32
  898. </span></dt><dd><p>
  899. The process ID of the notifying backend process.
  900. </p></dd><dt><span class="term">
  901. String
  902. </span></dt><dd><p>
  903. The name of the channel that the notify has been raised on.
  904. </p></dd><dt><span class="term">
  905. String
  906. </span></dt><dd><p>
  907. The <span class="quote">“<span class="quote">payload</span>”</span> string passed from the notifying process.
  908. </p></dd></dl></div><p>
  909. </p></dd><dt><span class="term">
  910. ParameterDescription (B)
  911. </span></dt><dd><p>
  912. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  913. Byte1('t')
  914. </span></dt><dd><p>
  915. Identifies the message as a parameter description.
  916. </p></dd><dt><span class="term">
  917. Int32
  918. </span></dt><dd><p>
  919. Length of message contents in bytes, including self.
  920. </p></dd><dt><span class="term">
  921. Int16
  922. </span></dt><dd><p>
  923. The number of parameters used by the statement
  924. (can be zero).
  925. </p></dd></dl></div><p>
  926. Then, for each parameter, there is the following:
  927. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  928. Int32
  929. </span></dt><dd><p>
  930. Specifies the object ID of the parameter data type.
  931. </p></dd></dl></div><p>
  932. </p></dd><dt><span class="term">
  933. ParameterStatus (B)
  934. </span></dt><dd><p>
  935. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  936. Byte1('S')
  937. </span></dt><dd><p>
  938. Identifies the message as a run-time parameter status report.
  939. </p></dd><dt><span class="term">
  940. Int32
  941. </span></dt><dd><p>
  942. Length of message contents in bytes, including self.
  943. </p></dd><dt><span class="term">
  944. String
  945. </span></dt><dd><p>
  946. The name of the run-time parameter being reported.
  947. </p></dd><dt><span class="term">
  948. String
  949. </span></dt><dd><p>
  950. The current value of the parameter.
  951. </p></dd></dl></div><p>
  952. </p></dd><dt><span class="term">
  953. Parse (F)
  954. </span></dt><dd><p>
  955. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  956. Byte1('P')
  957. </span></dt><dd><p>
  958. Identifies the message as a Parse command.
  959. </p></dd><dt><span class="term">
  960. Int32
  961. </span></dt><dd><p>
  962. Length of message contents in bytes, including self.
  963. </p></dd><dt><span class="term">
  964. String
  965. </span></dt><dd><p>
  966. The name of the destination prepared statement
  967. (an empty string selects the unnamed prepared statement).
  968. </p></dd><dt><span class="term">
  969. String
  970. </span></dt><dd><p>
  971. The query string to be parsed.
  972. </p></dd><dt><span class="term">
  973. Int16
  974. </span></dt><dd><p>
  975. The number of parameter data types specified
  976. (can be zero). Note that this is not an indication of
  977. the number of parameters that might appear in the
  978. query string, only the number that the frontend wants to
  979. prespecify types for.
  980. </p></dd></dl></div><p>
  981. Then, for each parameter, there is the following:
  982. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  983. Int32
  984. </span></dt><dd><p>
  985. Specifies the object ID of the parameter data type.
  986. Placing a zero here is equivalent to leaving the type
  987. unspecified.
  988. </p></dd></dl></div><p>
  989. </p></dd><dt><span class="term">
  990. ParseComplete (B)
  991. </span></dt><dd><p>
  992. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  993. Byte1('1')
  994. </span></dt><dd><p>
  995. Identifies the message as a Parse-complete indicator.
  996. </p></dd><dt><span class="term">
  997. Int32(4)
  998. </span></dt><dd><p>
  999. Length of message contents in bytes, including self.
  1000. </p></dd></dl></div><p>
  1001. </p></dd><dt><span class="term">
  1002. PasswordMessage (F)
  1003. </span></dt><dd><p>
  1004. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1005. Byte1('p')
  1006. </span></dt><dd><p>
  1007. Identifies the message as a password response. Note that
  1008. this is also used for GSSAPI, SSPI and SASL response messages.
  1009. The exact message type can be deduced from the context.
  1010. </p></dd><dt><span class="term">
  1011. Int32
  1012. </span></dt><dd><p>
  1013. Length of message contents in bytes, including self.
  1014. </p></dd><dt><span class="term">
  1015. String
  1016. </span></dt><dd><p>
  1017. The password (encrypted, if requested).
  1018. </p></dd></dl></div><p>
  1019. </p></dd><dt><span class="term">
  1020. PortalSuspended (B)
  1021. </span></dt><dd><p>
  1022. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1023. Byte1('s')
  1024. </span></dt><dd><p>
  1025. Identifies the message as a portal-suspended indicator.
  1026. Note this only appears if an Execute message's row-count limit
  1027. was reached.
  1028. </p></dd><dt><span class="term">
  1029. Int32(4)
  1030. </span></dt><dd><p>
  1031. Length of message contents in bytes, including self.
  1032. </p></dd></dl></div><p>
  1033. </p></dd><dt><span class="term">
  1034. Query (F)
  1035. </span></dt><dd><p>
  1036. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1037. Byte1('Q')
  1038. </span></dt><dd><p>
  1039. Identifies the message as a simple query.
  1040. </p></dd><dt><span class="term">
  1041. Int32
  1042. </span></dt><dd><p>
  1043. Length of message contents in bytes, including self.
  1044. </p></dd><dt><span class="term">
  1045. String
  1046. </span></dt><dd><p>
  1047. The query string itself.
  1048. </p></dd></dl></div><p>
  1049. </p></dd><dt><span class="term">
  1050. ReadyForQuery (B)
  1051. </span></dt><dd><p>
  1052. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1053. Byte1('Z')
  1054. </span></dt><dd><p>
  1055. Identifies the message type. ReadyForQuery is sent
  1056. whenever the backend is ready for a new query cycle.
  1057. </p></dd><dt><span class="term">
  1058. Int32(5)
  1059. </span></dt><dd><p>
  1060. Length of message contents in bytes, including self.
  1061. </p></dd><dt><span class="term">
  1062. Byte1
  1063. </span></dt><dd><p>
  1064. Current backend transaction status indicator.
  1065. Possible values are '<code class="literal">I</code>' if idle (not in
  1066. a transaction block); '<code class="literal">T</code>' if in a transaction
  1067. block; or '<code class="literal">E</code>' if in a failed transaction
  1068. block (queries will be rejected until block is ended).
  1069. </p></dd></dl></div><p>
  1070. </p></dd><dt><span class="term">
  1071. RowDescription (B)
  1072. </span></dt><dd><p>
  1073. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1074. Byte1('T')
  1075. </span></dt><dd><p>
  1076. Identifies the message as a row description.
  1077. </p></dd><dt><span class="term">
  1078. Int32
  1079. </span></dt><dd><p>
  1080. Length of message contents in bytes, including self.
  1081. </p></dd><dt><span class="term">
  1082. Int16
  1083. </span></dt><dd><p>
  1084. Specifies the number of fields in a row (can be zero).
  1085. </p></dd></dl></div><p>
  1086. Then, for each field, there is the following:
  1087. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1088. String
  1089. </span></dt><dd><p>
  1090. The field name.
  1091. </p></dd><dt><span class="term">
  1092. Int32
  1093. </span></dt><dd><p>
  1094. If the field can be identified as a column of a specific
  1095. table, the object ID of the table; otherwise zero.
  1096. </p></dd><dt><span class="term">
  1097. Int16
  1098. </span></dt><dd><p>
  1099. If the field can be identified as a column of a specific
  1100. table, the attribute number of the column; otherwise zero.
  1101. </p></dd><dt><span class="term">
  1102. Int32
  1103. </span></dt><dd><p>
  1104. The object ID of the field's data type.
  1105. </p></dd><dt><span class="term">
  1106. Int16
  1107. </span></dt><dd><p>
  1108. The data type size (see <code class="varname">pg_type.typlen</code>).
  1109. Note that negative values denote variable-width types.
  1110. </p></dd><dt><span class="term">
  1111. Int32
  1112. </span></dt><dd><p>
  1113. The type modifier (see <code class="varname">pg_attribute.atttypmod</code>).
  1114. The meaning of the modifier is type-specific.
  1115. </p></dd><dt><span class="term">
  1116. Int16
  1117. </span></dt><dd><p>
  1118. The format code being used for the field. Currently will
  1119. be zero (text) or one (binary). In a RowDescription
  1120. returned from the statement variant of Describe, the
  1121. format code is not yet known and will always be zero.
  1122. </p></dd></dl></div><p>
  1123. </p></dd><dt><span class="term">
  1124. SASLInitialResponse (F)
  1125. </span></dt><dd><p>
  1126. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1127. Byte1('p')
  1128. </span></dt><dd><p>
  1129. Identifies the message as an initial SASL response. Note that
  1130. this is also used for GSSAPI, SSPI and password response messages.
  1131. The exact message type is deduced from the context.
  1132. </p></dd><dt><span class="term">
  1133. Int32
  1134. </span></dt><dd><p>
  1135. Length of message contents in bytes, including self.
  1136. </p></dd><dt><span class="term">
  1137. String
  1138. </span></dt><dd><p>
  1139. Name of the SASL authentication mechanism that the client
  1140. selected.
  1141. </p></dd><dt><span class="term">
  1142. Int32
  1143. </span></dt><dd><p>
  1144. Length of SASL mechanism specific "Initial Client Response" that
  1145. follows, or -1 if there is no Initial Response.
  1146. </p></dd><dt><span class="term">
  1147. Byte<em class="replaceable"><code>n</code></em>
  1148. </span></dt><dd><p>
  1149. SASL mechanism specific "Initial Response".
  1150. </p></dd></dl></div><p>
  1151. </p></dd><dt><span class="term">
  1152. SASLResponse (F)
  1153. </span></dt><dd><p>
  1154. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1155. Byte1('p')
  1156. </span></dt><dd><p>
  1157. Identifies the message as a SASL response. Note that
  1158. this is also used for GSSAPI, SSPI and password response messages.
  1159. The exact message type can be deduced from the context.
  1160. </p></dd><dt><span class="term">
  1161. Int32
  1162. </span></dt><dd><p>
  1163. Length of message contents in bytes, including self.
  1164. </p></dd><dt><span class="term">
  1165. Byte<em class="replaceable"><code>n</code></em>
  1166. </span></dt><dd><p>
  1167. SASL mechanism specific message data.
  1168. </p></dd></dl></div><p>
  1169. </p></dd><dt><span class="term">
  1170. SSLRequest (F)
  1171. </span></dt><dd><p>
  1172. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1173. Int32(8)
  1174. </span></dt><dd><p>
  1175. Length of message contents in bytes, including self.
  1176. </p></dd><dt><span class="term">
  1177. Int32(80877103)
  1178. </span></dt><dd><p>
  1179. The <acronym class="acronym">SSL</acronym> request code. The value is chosen to contain
  1180. <code class="literal">1234</code> in the most significant 16 bits, and <code class="literal">5679</code> in the
  1181. least significant 16 bits. (To avoid confusion, this code
  1182. must not be the same as any protocol version number.)
  1183. </p></dd></dl></div><p>
  1184. </p></dd><dt><span class="term">
  1185. GSSENCRequest (F)
  1186. </span></dt><dd><p>
  1187. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1188. Int32(8)
  1189. </span></dt><dd><p>
  1190. Length of message contents in bytes, including self.
  1191. </p></dd><dt><span class="term">
  1192. Int32(80877104)
  1193. </span></dt><dd><p>
  1194. The <acronym class="acronym">GSSAPI</acronym> Encryption request code. The value is chosen to contain
  1195. <code class="literal">1234</code> in the most significant 16 bits, and <code class="literal">5680</code> in the
  1196. least significant 16 bits. (To avoid confusion, this code
  1197. must not be the same as any protocol version number.)
  1198. </p></dd></dl></div><p>
  1199. </p></dd><dt><span class="term">
  1200. StartupMessage (F)
  1201. </span></dt><dd><p>
  1202. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1203. Int32
  1204. </span></dt><dd><p>
  1205. Length of message contents in bytes, including self.
  1206. </p></dd><dt><span class="term">
  1207. Int32(196608)
  1208. </span></dt><dd><p>
  1209. The protocol version number. The most significant 16 bits are
  1210. the major version number (3 for the protocol described here).
  1211. The least significant 16 bits are the minor version number
  1212. (0 for the protocol described here).
  1213. </p></dd></dl></div><p>
  1214. The protocol version number is followed by one or more pairs of
  1215. parameter name and value strings. A zero byte is required as a
  1216. terminator after the last name/value pair.
  1217. Parameters can appear in any
  1218. order. <code class="literal">user</code> is required, others are optional.
  1219. Each parameter is specified as:
  1220. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1221. String
  1222. </span></dt><dd><p>
  1223. The parameter name. Currently recognized names are:
  1224. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1225. <code class="literal">user</code>
  1226. </span></dt><dd><p>
  1227. The database user name to connect as. Required;
  1228. there is no default.
  1229. </p></dd><dt><span class="term">
  1230. <code class="literal">database</code>
  1231. </span></dt><dd><p>
  1232. The database to connect to. Defaults to the user name.
  1233. </p></dd><dt><span class="term">
  1234. <code class="literal">options</code>
  1235. </span></dt><dd><p>
  1236. Command-line arguments for the backend. (This is
  1237. deprecated in favor of setting individual run-time
  1238. parameters.) Spaces within this string are
  1239. considered to separate arguments, unless escaped with
  1240. a backslash (<code class="literal">\</code>); write <code class="literal">\\</code> to
  1241. represent a literal backslash.
  1242. </p></dd><dt><span class="term">
  1243. <code class="literal">replication</code>
  1244. </span></dt><dd><p>
  1245. Used to connect in streaming replication mode, where
  1246. a small set of replication commands can be issued
  1247. instead of SQL statements. Value can be
  1248. <code class="literal">true</code>, <code class="literal">false</code>, or
  1249. <code class="literal">database</code>, and the default is
  1250. <code class="literal">false</code>. See
  1251. <a class="xref" href="protocol-replication.html" title="52.4. Streaming Replication Protocol">Section 52.4</a> for details.
  1252. </p></dd></dl></div><p>
  1253. In addition to the above, other parameters may be listed.
  1254. Parameter names beginning with <code class="literal">_pq_.</code> are
  1255. reserved for use as protocol extensions, while others are
  1256. treated as run-time parameters to be set at backend start
  1257. time. Such settings will be applied during backend start
  1258. (after parsing the command-line arguments if any) and will
  1259. act as session defaults.
  1260. </p></dd><dt><span class="term">
  1261. String
  1262. </span></dt><dd><p>
  1263. The parameter value.
  1264. </p></dd></dl></div><p>
  1265. </p></dd><dt><span class="term">
  1266. Sync (F)
  1267. </span></dt><dd><p>
  1268. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1269. Byte1('S')
  1270. </span></dt><dd><p>
  1271. Identifies the message as a Sync command.
  1272. </p></dd><dt><span class="term">
  1273. Int32(4)
  1274. </span></dt><dd><p>
  1275. Length of message contents in bytes, including self.
  1276. </p></dd></dl></div><p>
  1277. </p></dd><dt><span class="term">
  1278. Terminate (F)
  1279. </span></dt><dd><p>
  1280. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  1281. Byte1('X')
  1282. </span></dt><dd><p>
  1283. Identifies the message as a termination.
  1284. </p></dd><dt><span class="term">
  1285. Int32(4)
  1286. </span></dt><dd><p>
  1287. Length of message contents in bytes, including self.
  1288. </p></dd></dl></div><p>
  1289. </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="protocol-message-types.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="protocol-error-fields.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">52.6. Message Data Types </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 52.8. Error and Notice Message Fields</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1