1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>43.5.Error and Notice Message Fields</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="protocol.html" title="Chapter43.Frontend/Backend Protocol">
<link rel="prev" href="protocol-message-formats.html" title="43.4.Message Formats">
<link rel="next" href="protocol-changes.html" title="43.6.Summary of Changes since Protocol 2.0">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="protocol-error-fields"></a>43.5.Error and Notice Message Fields</h2></div></div></div>
<p>This section describes the fields that may appear in ErrorResponse and
NoticeResponse messages. Each field type has a single-byte identification
token. Note that any given field type should appear at most once per
message.</p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="literal">S</code></span></dt>
<dd><p> Severity: the field contents are
<code class="literal">ERROR</code>, <code class="literal">FATAL</code>, or
<code class="literal">PANIC</code> (in an error message), or
<code class="literal">WARNING</code>, <code class="literal">NOTICE</code>, <code class="literal">DEBUG</code>,
<code class="literal">INFO</code>, or <code class="literal">LOG</code> (in a notice message),
or a localized translation of one of these. Always present.</p></dd>
<dt><span class="term"><code class="literal">C</code></span></dt>
<dd><p> Code: the SQLSTATE code for the error (see <a href="errcodes-appendix.html" title="AppendixA.PostgreSQL Error Codes">AppendixA, <i><span class="productname">PostgreSQL</span> Error Codes</i></a>). Not localizable. Always present.</p></dd>
<dt><span class="term"><code class="literal">M</code></span></dt>
<dd><p> Message: the primary human-readable error message.
This should be accurate but terse (typically one line).
Always present.</p></dd>
<dt><span class="term"><code class="literal">D</code></span></dt>
<dd><p> Detail: an optional secondary error message carrying more
detail about the problem. May run to multiple lines.</p></dd>
<dt><span class="term"><code class="literal">H</code></span></dt>
<dd><p> Hint: an optional suggestion what to do about the problem.
This is intended to differ from Detail in that it offers advice
(potentially inappropriate) rather than hard facts.
May run to multiple lines.</p></dd>
<dt><span class="term"><code class="literal">P</code></span></dt>
<dd><p> Position: the field value is a decimal ASCII integer, indicating
an error cursor position as an index into the original query string.
The first character has index 1, and positions are measured in
characters not bytes.</p></dd>
<dt><span class="term"><code class="literal">p</code></span></dt>
<dd><p> Internal position: this is defined the same as the <code class="literal">P</code>
field, but it is used when the cursor position refers to an internally
generated command rather than the one submitted by the client.
The <code class="literal">q</code> field will always appear when this field appears.</p></dd>
<dt><span class="term"><code class="literal">q</code></span></dt>
<dd><p> Internal query: the text of a failed internally-generated command.
This could be, for example, a SQL query issued by a PL/pgSQL function.</p></dd>
<dt><span class="term"><code class="literal">W</code></span></dt>
<dd><p> Where: an indication of the context in which the error occurred.
Presently this includes a call stack traceback of active
procedural language functions and internally-generated queries.
The trace is one entry per line, most recent first.</p></dd>
<dt><span class="term"><code class="literal">F</code></span></dt>
<dd><p> File: the file name of the source-code location where the error
was reported.</p></dd>
<dt><span class="term"><code class="literal">L</code></span></dt>
<dd><p> Line: the line number of the source-code location where the error
was reported.</p></dd>
<dt><span class="term"><code class="literal">R</code></span></dt>
<dd><p> Routine: the name of the source-code routine reporting the error.</p></dd>
</dl></div>
<p>The client is responsible for formatting displayed information to meet its
needs; in particular it should break long lines as needed. Newline characters
appearing in the error message fields should be treated as paragraph breaks,
not line breaks.</p>
</div></body>
</html>
|