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>54.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 Vsnapshot" /><link rel="prev" href="protocol-message-formats.html" title="54.7. Message Formats" /><link rel="next" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">54.8. Error and Notice Message Fields</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-message-formats.html" title="54.7. Message Formats">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 54. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 54. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats">Next</a></td></tr></table><hr /></div><div class="sect1" id="PROTOCOL-ERROR-FIELDS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">54.8. Error and Notice Message Fields <a href="#PROTOCOL-ERROR-FIELDS" class="id_link">#</a></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
7 </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">S</code></span></dt><dd><p>
8 Severity: the field contents are
9 <code class="literal">ERROR</code>, <code class="literal">FATAL</code>, or
10 <code class="literal">PANIC</code> (in an error message), or
11 <code class="literal">WARNING</code>, <code class="literal">NOTICE</code>, <code class="literal">DEBUG</code>,
12 <code class="literal">INFO</code>, or <code class="literal">LOG</code> (in a notice message),
13 or a localized translation of one of these. Always present.
14 </p></dd><dt><span class="term"><code class="literal">V</code></span></dt><dd><p>
15 Severity: the field contents are
16 <code class="literal">ERROR</code>, <code class="literal">FATAL</code>, or
17 <code class="literal">PANIC</code> (in an error message), or
18 <code class="literal">WARNING</code>, <code class="literal">NOTICE</code>, <code class="literal">DEBUG</code>,
19 <code class="literal">INFO</code>, or <code class="literal">LOG</code> (in a notice message).
20 This is identical to the <code class="literal">S</code> field except
21 that the contents are never localized. This is present only in
22 messages generated by <span class="productname">PostgreSQL</span> versions 9.6
24 </p></dd><dt><span class="term"><code class="literal">C</code></span></dt><dd><p>
25 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.
26 </p></dd><dt><span class="term"><code class="literal">M</code></span></dt><dd><p>
27 Message: the primary human-readable error message.
28 This should be accurate but terse (typically one line).
30 </p></dd><dt><span class="term"><code class="literal">D</code></span></dt><dd><p>
31 Detail: an optional secondary error message carrying more
32 detail about the problem. Might run to multiple lines.
33 </p></dd><dt><span class="term"><code class="literal">H</code></span></dt><dd><p>
34 Hint: an optional suggestion what to do about the problem.
35 This is intended to differ from Detail in that it offers advice
36 (potentially inappropriate) rather than hard facts.
37 Might run to multiple lines.
38 </p></dd><dt><span class="term"><code class="literal">P</code></span></dt><dd><p>
39 Position: the field value is a decimal ASCII integer, indicating
40 an error cursor position as an index into the original query string.
41 The first character has index 1, and positions are measured in
43 </p></dd><dt><span class="term"><code class="literal">p</code></span></dt><dd><p>
44 Internal position: this is defined the same as the <code class="literal">P</code>
45 field, but it is used when the cursor position refers to an internally
46 generated command rather than the one submitted by the client.
47 The <code class="literal">q</code> field will always appear when this field appears.
48 </p></dd><dt><span class="term"><code class="literal">q</code></span></dt><dd><p>
49 Internal query: the text of a failed internally-generated command.
50 This could be, for example, an SQL query issued by a PL/pgSQL function.
51 </p></dd><dt><span class="term"><code class="literal">W</code></span></dt><dd><p>
52 Where: an indication of the context in which the error occurred.
53 Presently this includes a call stack traceback of active
54 procedural language functions and internally-generated queries.
55 The trace is one entry per line, most recent first.
56 </p></dd><dt><span class="term"><code class="literal">s</code></span></dt><dd><p>
57 Schema name: if the error was associated with a specific database
58 object, the name of the schema containing that object, if any.
59 </p></dd><dt><span class="term"><code class="literal">t</code></span></dt><dd><p>
60 Table name: if the error was associated with a specific table, the
61 name of the table. (Refer to the schema name field for the name of
63 </p></dd><dt><span class="term"><code class="literal">c</code></span></dt><dd><p>
64 Column name: if the error was associated with a specific table column,
65 the name of the column. (Refer to the schema and table name fields to
67 </p></dd><dt><span class="term"><code class="literal">d</code></span></dt><dd><p>
68 Data type name: if the error was associated with a specific data type,
69 the name of the data type. (Refer to the schema name field for the
70 name of the data type's schema.)
71 </p></dd><dt><span class="term"><code class="literal">n</code></span></dt><dd><p>
72 Constraint name: if the error was associated with a specific
73 constraint, the name of the constraint. Refer to fields listed above
74 for the associated table or domain. (For this purpose, indexes are
75 treated as constraints, even if they weren't created with constraint
77 </p></dd><dt><span class="term"><code class="literal">F</code></span></dt><dd><p>
78 File: the file name of the source-code location where the error
80 </p></dd><dt><span class="term"><code class="literal">L</code></span></dt><dd><p>
81 Line: the line number of the source-code location where the error
83 </p></dd><dt><span class="term"><code class="literal">R</code></span></dt><dd><p>
84 Routine: the name of the source-code routine reporting the error.
85 </p></dd></dl></div><div class="note"><h3 class="title">Note</h3><p>
86 The fields for schema name, table name, column name, data type name, and
87 constraint name are supplied only for a limited number of error types;
88 see <a class="xref" href="errcodes-appendix.html" title="Appendix A. PostgreSQL Error Codes">Appendix A</a>. Frontends should not assume that
89 the presence of any of these fields guarantees the presence of another
90 field. Core error sources observe the interrelationships noted above, but
91 user-defined functions may use these fields in other ways. In the same
92 vein, clients should not assume that these fields denote contemporary
93 objects in the current database.
95 The client is responsible for formatting displayed information to meet its
96 needs; in particular it should break long lines as needed. Newline characters
97 appearing in the error message fields should be treated as paragraph breaks,
99 </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" title="54.7. Message Formats">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html" title="Chapter 54. Frontend/Backend Protocol">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="protocol-logicalrep-message-formats.html" title="54.9. Logical Replication Message Formats">Next</a></td></tr><tr><td width="40%" align="left" valign="top">54.7. Message Formats </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 54.9. Logical Replication Message Formats</td></tr></table></div></body></html>