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

DISCARD

DISCARD <refpurpose>discard session state</refpurpose> — セッションの状態を破棄する

概要

DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }

説明

<title>Description</title>

<command>DISCARD</command> releases internal resources associated with a database session. This command is useful for partially or fully resetting the session's state. There are several subcommands to release different types of resources; the <command>DISCARD ALL</command> variant subsumes all the others, and also resets additional state. DISCARDはデータベースセッションに関連した内部リソースを解放します。 このコマンドはセッションの状態を部分的あるいは完全にリセットするのに役に立ちます。 様々な種類のリソースを解放するためにいくつかのサブコマンドがあります。 DISCARD ALLは他のすべてを包含し、さらにまた追加の状態もリセットします。

パラメータ

<title>Parameters</title>
PLANS

Releases all cached query plans, forcing re-planning to occur the next time the associated prepared statement is used. キャッシュされた問い合わせ計画をすべて解放します。 これにより、関連するプリペアド文が次に使われたとき、強制的に計画がやり直されます。

SEQUENCES

Discards all cached sequence-related state, including <function>currval()</function>/<function>lastval()</function> information and any preallocated sequence values that have not yet been returned by <function>nextval()</function>. (See <xref linkend="sql-createsequence"/> for a description of preallocated sequence values.) キャッシュされたシーケンスに関連する状態をすべて破棄します。 これには、currval()/lastval()の情報、および事前に割り当てられたシーケンスの値で、まだnextval()によって返されていないものを含みます。 (事前に割り当てられたシーケンスの値についてはCREATE SEQUENCEを参照してください。)

TEMPORARYまたはTEMP

Drops all temporary tables created in the current session. 現在のセッションで作成された一時テーブルをすべて削除します。

ALL

Releases all temporary resources associated with the current session and resets the session to its initial state. Currently, this has the same effect as executing the following sequence of statements: 現在のセッションに関連付いた一時的なリソースを解放し、セッションを初期状態に戻します。 現時点でこれは、以下に示す一連の文を実行することと同じ効果があります。

CLOSE ALL;
SET SESSION AUTHORIZATION DEFAULT;
RESET ALL;
DEALLOCATE ALL;
UNLISTEN *;
SELECT pg_advisory_unlock_all();
DISCARD PLANS;
DISCARD TEMP;
DISCARD SEQUENCES;

注釈

<title>Notes</title>

<command>DISCARD ALL</command> cannot be executed inside a transaction block. DISCARD ALLをトランザクションブロック内で実行することはできません。

互換性

<title>Compatibility</title>

<command>DISCARD</command> is a <productname>PostgreSQL</productname> extension. DISCARDPostgreSQLの拡張です。