UNLISTEN

Name

UNLISTEN -- Stop listening for notification 通知の監視を停止する。

Synopsis

UNLISTEN { notifyname | * }

入力

notifyname

Name of previously registered notify condition.

事前に登録された通知条件名。

*

All current listen registrations for this backend are cleared.

現在このコマンドの処理を行なうバックエンドにある、全ての監視登録をク リアします。

出力

UNLISTEN

Acknowledgement that statement has executed.

命令文が実行された証明。

説明

UNLISTEN is used to remove an existing NOTIFY registration. UNLISTEN cancels any existing registration of the current Postgres session as a listener on the notify condition notifyname. The special condition wildcard "*" cancels all listener registrations for the current session.

UNLISTEN は 既存の NOTIFY による 登録を削除することに使用されます。UNLISTEN は現在の Postgres セッションにある、通知条件 notifyname 用のリスナー登 録を全て取り消します。ワイルドカード "*" は特別な条件を示すもので、現 在のセッションにある全てのリスナー登録を取り消します。

NOTIFY contains a more extensive discussion of the use of LISTEN and NOTIFY.

NOTIFY には、 LISTENNOTIFY についての、より 広範な説明があります。

注意

classname needs not to be a valid class name but can be any string valid as a name up to 32 characters long.

classname は有効なクラス 名である必要はありませんが、その文字列長は 32 文字までという制限があ ります。 (訳注: classnameはnotifynameの間違いだと思われます。)

The backend does not complain if you UNLISTEN something you were not listening for. Each backend will automatically execute UNLISTEN * when exiting.

監視をしていないものに対して UNLISTEN を行なったとしても、バックエンド は警告を行ないません。各バックエンドはその終了時に自動的に UNLISTEN * を実行します。

A restriction in some previous releases of Postgres that a classname which does not correspond to an actual table must be enclosed in double-quotes is no longer present.

Postgres の以前のリリースにあった、実際の テーブルに対応していない classname はダブルクォート で括らなければならないという制限はもうありません。 (訳注: classname は notifyname の間違いだと思われます。) libpq.sgmlによると、一般的にはnotifynameには関連するclassnameが使われ るとのです。

使用法

postgres=> LISTEN virtual;
LISTEN
postgres=> NOTIFY virtual;
NOTIFY
ASYNC NOTIFY of 'virtual' from backend pid '12317' received
postgres=> UNLISTEN virtual;
UNLISTEN
postgres=> NOTIFY virtual;
NOTIFY

-- notice no NOTIFY event is received
-- NOTIFY イベントを受け取らなかった点に注目して下さい。
postgres=>

互換性

SQL92

There is no UNLISTEN in SQL92.

SQL92 には UNLISTEN 文はあり ません。