gooderp18绿色标准版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

135 行
9.1KB

  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.8. Error and Notice Message Fields</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-formats.html" title="52.7. Message Formats" /><link rel="next" href="protocol-logicalrep-message-formats.html" title="52.9. Logical Replication Message Formats" /></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.8. Error and Notice Message Fields</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-message-formats.html" title="52.7. 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="protocol-logicalrep-message-formats.html" title="52.9. Logical Replication Message Formats">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="PROTOCOL-ERROR-FIELDS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.8. Error and Notice Message Fields</h2></div></div></div><p>
  3. This section describes the fields that can appear in ErrorResponse and
  4. NoticeResponse messages. Each field type has a single-byte identification
  5. token. Note that any given field type should appear at most once per
  6. message.
  7. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  8. <code class="literal">S</code>
  9. </span></dt><dd><p>
  10. Severity: the field contents are
  11. <code class="literal">ERROR</code>, <code class="literal">FATAL</code>, or
  12. <code class="literal">PANIC</code> (in an error message), or
  13. <code class="literal">WARNING</code>, <code class="literal">NOTICE</code>, <code class="literal">DEBUG</code>,
  14. <code class="literal">INFO</code>, or <code class="literal">LOG</code> (in a notice message),
  15. or a localized translation of one of these. Always present.
  16. </p></dd><dt><span class="term">
  17. <code class="literal">V</code>
  18. </span></dt><dd><p>
  19. Severity: the field contents are
  20. <code class="literal">ERROR</code>, <code class="literal">FATAL</code>, or
  21. <code class="literal">PANIC</code> (in an error message), or
  22. <code class="literal">WARNING</code>, <code class="literal">NOTICE</code>, <code class="literal">DEBUG</code>,
  23. <code class="literal">INFO</code>, or <code class="literal">LOG</code> (in a notice message).
  24. This is identical to the <code class="literal">S</code> field except
  25. that the contents are never localized. This is present only in
  26. messages generated by <span class="productname">PostgreSQL</span> versions 9.6
  27. and later.
  28. </p></dd><dt><span class="term">
  29. <code class="literal">C</code>
  30. </span></dt><dd><p>
  31. Code: the SQLSTATE code for the error (see <a class="xref" href="errcodes-appendix.html" title="Appendix A. PostgreSQL Error Codes">Appendix A</a>). Not localizable. Always present.
  32. </p></dd><dt><span class="term">
  33. <code class="literal">M</code>
  34. </span></dt><dd><p>
  35. Message: the primary human-readable error message.
  36. This should be accurate but terse (typically one line).
  37. Always present.
  38. </p></dd><dt><span class="term">
  39. <code class="literal">D</code>
  40. </span></dt><dd><p>
  41. Detail: an optional secondary error message carrying more
  42. detail about the problem. Might run to multiple lines.
  43. </p></dd><dt><span class="term">
  44. <code class="literal">H</code>
  45. </span></dt><dd><p>
  46. Hint: an optional suggestion what to do about the problem.
  47. This is intended to differ from Detail in that it offers advice
  48. (potentially inappropriate) rather than hard facts.
  49. Might run to multiple lines.
  50. </p></dd><dt><span class="term">
  51. <code class="literal">P</code>
  52. </span></dt><dd><p>
  53. Position: the field value is a decimal ASCII integer, indicating
  54. an error cursor position as an index into the original query string.
  55. The first character has index 1, and positions are measured in
  56. characters not bytes.
  57. </p></dd><dt><span class="term">
  58. <code class="literal">p</code>
  59. </span></dt><dd><p>
  60. Internal position: this is defined the same as the <code class="literal">P</code>
  61. field, but it is used when the cursor position refers to an internally
  62. generated command rather than the one submitted by the client.
  63. The <code class="literal">q</code> field will always appear when this field appears.
  64. </p></dd><dt><span class="term">
  65. <code class="literal">q</code>
  66. </span></dt><dd><p>
  67. Internal query: the text of a failed internally-generated command.
  68. This could be, for example, a SQL query issued by a PL/pgSQL function.
  69. </p></dd><dt><span class="term">
  70. <code class="literal">W</code>
  71. </span></dt><dd><p>
  72. Where: an indication of the context in which the error occurred.
  73. Presently this includes a call stack traceback of active
  74. procedural language functions and internally-generated queries.
  75. The trace is one entry per line, most recent first.
  76. </p></dd><dt><span class="term">
  77. <code class="literal">s</code>
  78. </span></dt><dd><p>
  79. Schema name: if the error was associated with a specific database
  80. object, the name of the schema containing that object, if any.
  81. </p></dd><dt><span class="term">
  82. <code class="literal">t</code>
  83. </span></dt><dd><p>
  84. Table name: if the error was associated with a specific table, the
  85. name of the table. (Refer to the schema name field for the name of
  86. the table's schema.)
  87. </p></dd><dt><span class="term">
  88. <code class="literal">c</code>
  89. </span></dt><dd><p>
  90. Column name: if the error was associated with a specific table column,
  91. the name of the column. (Refer to the schema and table name fields to
  92. identify the table.)
  93. </p></dd><dt><span class="term">
  94. <code class="literal">d</code>
  95. </span></dt><dd><p>
  96. Data type name: if the error was associated with a specific data type,
  97. the name of the data type. (Refer to the schema name field for the
  98. name of the data type's schema.)
  99. </p></dd><dt><span class="term">
  100. <code class="literal">n</code>
  101. </span></dt><dd><p>
  102. Constraint name: if the error was associated with a specific
  103. constraint, the name of the constraint. Refer to fields listed above
  104. for the associated table or domain. (For this purpose, indexes are
  105. treated as constraints, even if they weren't created with constraint
  106. syntax.)
  107. </p></dd><dt><span class="term">
  108. <code class="literal">F</code>
  109. </span></dt><dd><p>
  110. File: the file name of the source-code location where the error
  111. was reported.
  112. </p></dd><dt><span class="term">
  113. <code class="literal">L</code>
  114. </span></dt><dd><p>
  115. Line: the line number of the source-code location where the error
  116. was reported.
  117. </p></dd><dt><span class="term">
  118. <code class="literal">R</code>
  119. </span></dt><dd><p>
  120. Routine: the name of the source-code routine reporting the error.
  121. </p></dd></dl></div><div class="note"><h3 class="title">Note</h3><p>
  122. The fields for schema name, table name, column name, data type name, and
  123. constraint name are supplied only for a limited number of error types;
  124. see <a class="xref" href="errcodes-appendix.html" title="Appendix A. PostgreSQL Error Codes">Appendix A</a>. Frontends should not assume that
  125. the presence of any of these fields guarantees the presence of another
  126. field. Core error sources observe the interrelationships noted above, but
  127. user-defined functions may use these fields in other ways. In the same
  128. vein, clients should not assume that these fields denote contemporary
  129. objects in the current database.
  130. </p></div><p>
  131. The client is responsible for formatting displayed information to meet its
  132. needs; in particular it should break long lines as needed. Newline characters
  133. appearing in the error message fields should be treated as paragraph breaks,
  134. not line breaks.
  135. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="protocol-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="protocol-logicalrep-message-formats.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">52.7. Message Formats </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 52.9. Logical Replication Message Formats</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1