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

DROP RULE

DROP RULE <refpurpose>remove a rewrite rule</refpurpose> — 書き換えルールを削除する

概要

DROP RULE [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]

説明

<title>Description</title>

<command>DROP RULE</command> drops a rewrite rule. DROP RULEは書き換えルールを削除します。

パラメータ

<title>Parameters</title>
IF EXISTS

Do not throw an error if the rule does not exist. A notice is issued in this case. ルールが存在しない場合でもエラーになりません。 この場合注意メッセージが発行されます。

name

The name of the rule to drop. 削除するルールの名前です。

table_name

The name (optionally schema-qualified) of the table or view that the rule applies to. そのルールが適用されたテーブルもしくはビューの名前です(スキーマ修飾名も可)。

CASCADE

Automatically drop objects that depend on the rule, and in turn all objects that depend on those objects (see <xref linkend="ddl-depend"/>). ルールに依存するオブジェクトを自動的に削除し、さらにそれらのオブジェクトに依存するすべてのオブジェクトも削除します(5.14参照)。

RESTRICT

Refuse to drop the rule if any objects depend on it. This is the default. 依存するオブジェクトがある場合、ルールの削除を拒否します。 こちらがデフォルトです。

<title>Examples</title>

To drop the rewrite rule <literal>newrule</literal>: newruleという書き換えルールを削除します。

DROP RULE newrule ON mytable;

互換性

<title>Compatibility</title>

<command>DROP RULE</command> is a <productname>PostgreSQL</productname> language extension, as is the entire query rewrite system. DROP RULEPostgreSQLの言語拡張で、問い合わせ書き換えシステム全体も言語拡張です。

関連項目

<title>See Also</title> CREATE RULE, ALTER RULE