]> begriffs open source - ai-pg/blob - full-docs/txt/protocol-error-fields.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / protocol-error-fields.txt
1
2 54.8. Error and Notice Message Fields #
3
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
7    most once per message.
8
9    S
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.
13           Always present.
14
15    V
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.
21
22    C
23           Code: the SQLSTATE code for the error (see Appendix A). Not
24           localizable. Always present.
25
26    M
27           Message: the primary human-readable error message. This should
28           be accurate but terse (typically one line). Always present.
29
30    D
31           Detail: an optional secondary error message carrying more detail
32           about the problem. Might run to multiple lines.
33
34    H
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
38           multiple lines.
39
40    P
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.
45
46    p
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.
51
52    q
53           Internal query: the text of a failed internally-generated
54           command. This could be, for example, an SQL query issued by a
55           PL/pgSQL function.
56
57    W
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.
62
63    s
64           Schema name: if the error was associated with a specific
65           database object, the name of the schema containing that object,
66           if any.
67
68    t
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.)
72
73    c
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.)
77
78    d
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.)
82
83    n
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.)
89
90    F
91           File: the file name of the source-code location where the error
92           was reported.
93
94    L
95           Line: the line number of the source-code location where the
96           error was reported.
97
98    R
99           Routine: the name of the source-code routine reporting the
100           error.
101
102 Note
103
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.
112
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.