2 54.8. Error and Notice Message Fields #
4 This section describes the fields that can appear in ErrorResponse and
5 NoticeResponse messages. Each field type has a single-byte
6 identification token. Note that any given field type should appear at
10 Severity: the field contents are ERROR, FATAL, or PANIC (in an
11 error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a
12 notice message), or a localized translation of one of these.
16 Severity: the field contents are ERROR, FATAL, or PANIC (in an
17 error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a
18 notice message). This is identical to the S field except that
19 the contents are never localized. This is present only in
20 messages generated by PostgreSQL versions 9.6 and later.
23 Code: the SQLSTATE code for the error (see Appendix A). Not
24 localizable. Always present.
27 Message: the primary human-readable error message. This should
28 be accurate but terse (typically one line). Always present.
31 Detail: an optional secondary error message carrying more detail
32 about the problem. Might run to multiple lines.
35 Hint: an optional suggestion what to do about the problem. This
36 is intended to differ from Detail in that it offers advice
37 (potentially inappropriate) rather than hard facts. Might run to
41 Position: the field value is a decimal ASCII integer, indicating
42 an error cursor position as an index into the original query
43 string. The first character has index 1, and positions are
44 measured in characters not bytes.
47 Internal position: this is defined the same as the P field, but
48 it is used when the cursor position refers to an internally
49 generated command rather than the one submitted by the client.
50 The q field will always appear when this field appears.
53 Internal query: the text of a failed internally-generated
54 command. This could be, for example, an SQL query issued by a
58 Where: an indication of the context in which the error occurred.
59 Presently this includes a call stack traceback of active
60 procedural language functions and internally-generated queries.
61 The trace is one entry per line, most recent first.
64 Schema name: if the error was associated with a specific
65 database object, the name of the schema containing that object,
69 Table name: if the error was associated with a specific table,
70 the name of the table. (Refer to the schema name field for the
71 name of the table's schema.)
74 Column name: if the error was associated with a specific table
75 column, the name of the column. (Refer to the schema and table
76 name fields to identify the table.)
79 Data type name: if the error was associated with a specific data
80 type, the name of the data type. (Refer to the schema name field
81 for the name of the data type's schema.)
84 Constraint name: if the error was associated with a specific
85 constraint, the name of the constraint. Refer to fields listed
86 above for the associated table or domain. (For this purpose,
87 indexes are treated as constraints, even if they weren't created
88 with constraint syntax.)
91 File: the file name of the source-code location where the error
95 Line: the line number of the source-code location where the
99 Routine: the name of the source-code routine reporting the
104 The fields for schema name, table name, column name, data type name,
105 and constraint name are supplied only for a limited number of error
106 types; see Appendix A. Frontends should not assume that the presence of
107 any of these fields guarantees the presence of another field. Core
108 error sources observe the interrelationships noted above, but
109 user-defined functions may use these fields in other ways. In the same
110 vein, clients should not assume that these fields denote contemporary
111 objects in the current database.
113 The client is responsible for formatting displayed information to meet
114 its needs; in particular it should break long lines as needed. Newline
115 characters appearing in the error message fields should be treated as
116 paragraph breaks, not line breaks.