バージョンごとのドキュメント一覧

55.8. エラーおよび警報メッセージフィールド #

<title>Error and Notice Message Fields</title>

This section describes the fields that can 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. 本節では、ErrorResponseおよびNoticeResponseメッセージ内で現れる可能性があるフィールドについて説明します。 それぞれのフィールド種類は、単一バイトの識別子トークンを持ちます。 メッセージ内に与えられる任意のフィールド種類は、多くてもメッセージ当たり1つでなければならないことに注意してください。

S

Severity: the field contents are <literal>ERROR</literal>, <literal>FATAL</literal>, or <literal>PANIC</literal> (in an error message), or <literal>WARNING</literal>, <literal>NOTICE</literal>, <literal>DEBUG</literal>, <literal>INFO</literal>, or <literal>LOG</literal> (in a notice message), or a localized translation of one of these. Always present. 深刻度です。 フィールドの内容はERRORFATALPANIC(エラーメッセージ内)、WARNINGNOTICEDEBUGINFOLOG(警報メッセージ内)、もしくはこれらの1つの地域化された翻訳です。 常に存在します。

V

Severity: the field contents are <literal>ERROR</literal>, <literal>FATAL</literal>, or <literal>PANIC</literal> (in an error message), or <literal>WARNING</literal>, <literal>NOTICE</literal>, <literal>DEBUG</literal>, <literal>INFO</literal>, or <literal>LOG</literal> (in a notice message). This is identical to the <literal>S</literal> field except that the contents are never localized. This is present only in messages generated by <productname>PostgreSQL</productname> versions 9.6 and later. 深刻度です。 フィールドの内容はERRORFATALPANIC(エラーメッセージ内)、WARNINGNOTICEDEBUGINFOLOG(警報メッセージ内)です。 これは、その内容が決して地域化されないという点以外はSフィールドと同一です。 これはPostgreSQLバージョン9.6以降で生成されたメッセージにだけあります。

C

Code: the SQLSTATE code for the error (see <xref linkend="errcodes-appendix"/>). Not localizable. Always present. コード、そのエラー用のSQLSTATEコードです(付録Aを参照)。 地域化されません。 常に存在します。

M

Message: the primary human-readable error message. This should be accurate but terse (typically one line). Always present. メッセージ、主に人にわかりやすいエラーメッセージです。 これは正確、簡潔でなければなりません(通常は1行です)。 常に存在します。

D

Detail: an optional secondary error message carrying more detail about the problem. Might run to multiple lines. 詳細です。 問題のより詳細を説明する省略可能な二次的なエラーメッセージです。 複数行にまたがる可能性があります。

H

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. Might run to multiple lines. ヒントです。 その問題にどう対応するかを表す省略可能な提言です。 これは、詳細と異なり、事実ではなく提案(不適切な場合もありますが)を提供することを目的としたものです。 複数行にまたがる可能性があります。

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. 位置です。 フィールド値は、エラーカーソルの位置を示すもので、元の問い合わせ文字列へのインデックスを10進ASCIIで表した整数です。 先頭の文字がインデックス1になり、位置はバイトではなく文字で数えられます。

p

Internal position: this is defined the same as the <literal>P</literal> field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The <literal>q</literal> field will always appear when this field appears. 内部的位置です。 これはPと同じ定義ですが、カーソルの位置がクライアントによって発せられたコマンドではなく内部的に生成されたコマンドを参照する場合に使用されます。 このフィールドが現れる時には常にqも現れます。

q

Internal query: the text of a failed internally-generated command. This could be, for example, an SQL query issued by a PL/pgSQL function. 内部的問い合わせ。 失敗した、内部生成のコマンドテキストです。 これは例えば、PL/pgSQL関数によって発行されたSQL問い合わせなどです。

W

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. 場所です。 エラーが発生したコンテキストを示します。 現在ここには、実行中の手続き言語関数と内部生成問い合わせの呼び出しスタックトレースバックが含まれます。 この追跡情報は、1行当たり1項目として、最も最近のものが初めに現れます。

s

Schema name: if the error was associated with a specific database object, the name of the schema containing that object, if any. スキーマ名。 エラーが特定のデータベースオブジェクトに関連する場合、そのオブジェクトを含むスキーマ名。 無名でなければ。

t

Table name: if the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.) テーブル名。 エラーが特定のテーブルに関連する場合、そのテーブル名。 (スキーマ名フィールドにおいて、そのテーブルのスキーマ名を参照します。)

c

Column name: if the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.) 列名。 エラーが特定のテーブルの列に関連する場合、その列名。 (テーブルを識別するため、スキーマ名とテーブル名のフィールドを参照します。)

d

Data type name: if the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.) データ型名。 エラーが特定のデータ型に関連する場合、そのデータ型名。 (スキーマ名フィールドにおいて、そのデータ型のスキーマ名を参照します。)

n

Constraint name: if the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.) 制約名。 エラーが特定の制約に関連する場合、その制約名。 上に列挙したフィールドにおいて、関連するテーブルまたはドメインを参照します。 (この目的のために、制約の構文のもとに作成されていない場合でも、インデックスは制約として扱われます。)

F

File: the file name of the source-code location where the error was reported. ファイルです。 エラーを報告した、ソースコードのファイル名です。

L

Line: the line number of the source-code location where the error was reported. 行です。 エラーを報告した、ソースコードの行番号です。

R

Routine: the name of the source-code routine reporting the error. ルーチンです。 エラーを報告した、ソースコードのルーチン名です。

注記

The fields for schema name, table name, column name, data type name, and constraint name are supplied only for a limited number of error types; see <xref linkend="errcodes-appendix"/>. Frontends should not assume that the presence of any of these fields guarantees the presence of another field. Core error sources observe the interrelationships noted above, but user-defined functions may use these fields in other ways. In the same vein, clients should not assume that these fields denote contemporary objects in the current database. スキーマ名、テーブル名、列名、データ型名および制約名のフィールドは、限られたエラー型のためにしか提供されません。 付録Aを参照してください。 フロントエンドは、これらのフィールドの一部の存在が、他のフィールドの存在も保障すると仮定してはいけません。 上記の相互関係により主なエラーの原因を探す方法がありますが、ユーザが定義した関数は他の方法でこれらのフィールドを利用できるかもしれません。 同様の理由により、クライアントはこれらのフィールドが、現在のデータベースにおける適切なオブジェクトを示すと仮定してはいけません。

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. クライアントには、必要な情報を表示する際、整形する責任があります。 具体的には、必要に応じて長い行を分割しなければなりません。 エラーメッセージフィールド内にある改行文字は、改行ではなく、段落の区切りとして扱わなければなりません。