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

54.15. pg_prepared_statements #

The <structname>pg_prepared_statements</structname> view displays all the prepared statements that are available in the current session. See <xref linkend="sql-prepare"/> for more information about prepared statements. pg_prepared_statementsビューは現在のセッションで利用可能な準備済み文をすべて表示します。 準備済み文についての詳細はPREPAREを参照してください。

<structname>pg_prepared_statements</structname> contains one row for each prepared statement. Rows are added to the view when a new prepared statement is created and removed when a prepared statement is released (for example, via the <link linkend="sql-deallocate"><command>DEALLOCATE</command></link> command). pg_prepared_statementsには、1つの準備済み文に対して一行が存在します。 新しい準備済み文が作成されると行が追加され、準備済み文が解放される(例えばDEALLOCATEを使用)と行が削除されます。

表54.15 pg_prepared_statementsの列

<title><structname>pg_prepared_statements</structname> Columns</title>

Column Type 列 型

Description 説明

name text

The identifier of the prepared statement 準備済み文の識別子

statement text

The query string submitted by the client to create this prepared statement. For prepared statements created via SQL, this is the <command>PREPARE</command> statement submitted by the client. For prepared statements created via the frontend/backend protocol, this is the text of the prepared statement itself. この準備済み文を作成するためにクライアントが送付した問い合わせ文字列。 SQL経由で作成された準備済み文では、これはクライアントが送信したPREPARE文です。 フロントエンド/バックエンドプロトコル経由で作成された準備済み文では、これは準備済み文自身のテキストです。

prepare_time timestamptz

The time at which the prepared statement was created 準備済み文が作成された時間

parameter_types regtype[]

The expected parameter types for the prepared statement in the form of an array of <type>regtype</type>. The OID corresponding to an element of this array can be obtained by casting the <type>regtype</type> value to <type>oid</type>. regtype配列形式の準備済み文が想定しているパラメータ型。 配列要素に対応するOIDは、regtypeからoidへのキャストを行うことで取り出すことができます。

result_types regtype[]

The types of the columns returned by the prepared statement in the form of an array of <type>regtype</type>. The OID corresponding to an element of this array can be obtained by casting the <type>regtype</type> value to <type>oid</type>. If the prepared statement does not provide a result (e.g., a DML statement), then this field will be null. regtype配列形式の準備済み文が返す列の型。 配列要素に対応するOIDは、regtypeからoidへのキャストを行うことで取り出すことができます。 準備済み文が結果を提供しない場合(例えばDML文)は、このフィールドはNULLになります。

from_sql bool

<literal>true</literal> if the prepared statement was created via the <command>PREPARE</command> SQL command; <literal>false</literal> if the statement was prepared via the frontend/backend protocol trueの場合は、準備済み文がPREPARE SQLコマンド経由で作成された。 falseの場合は、フロントエンド/バックエンドプロトコル経由で文が準備された

generic_plans int8

Number of times generic plan was chosen 汎用計画が選択された回数

custom_plans int8

Number of times custom plan was chosen カスタム計画が選択された回数


The <structname>pg_prepared_statements</structname> view is read-only. pg_prepared_statementsビューは読み取り専用です。