DROP TRIGGER <refpurpose>remove a trigger</refpurpose> — トリガを削除する
DROP TRIGGER [ IF EXISTS ]nameONtable_name[ CASCADE | RESTRICT ]
<command>DROP TRIGGER</command> removes an existing
trigger definition. To execute this command, the current
user must be the owner of the table for which the trigger is defined.
DROP TRIGGERは既存のトリガ定義を削除します。
このコマンドを実行できるのは、トリガが定義されたテーブルの所有者のみです。
IF EXISTSDo not throw an error if the trigger does not exist. A notice is issued in this case. トリガが存在しない場合でもエラーになりません。この場合注意メッセージが発行されます。
nameThe name of the trigger to remove. 削除するトリガの名前です。
table_nameThe name (optionally schema-qualified) of the table for which the trigger is defined. トリガが定義されたテーブルの名前です(スキーマ修飾名も可)。
CASCADEAutomatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see <xref linkend="ddl-depend"/>). このトリガに依存しているオブジェクトを自動的に削除し、さらにそれらのオブジェクトに依存するすべてのオブジェクトも削除します(5.15参照)。
RESTRICTRefuse to drop the trigger if any objects depend on it. This is the default. 依存しているオブジェクトがある場合に、トリガの削除を拒否します。 こちらがデフォルトです。
Destroy the trigger <literal>if_dist_exists</literal> on the table
<literal>films</literal>:
テーブルfilmsにあるトリガif_dist_existsを削除します。
DROP TRIGGER if_dist_exists ON films;
The <command>DROP TRIGGER</command> statement in
<productname>PostgreSQL</productname> is incompatible with the SQL
standard. In the SQL standard, trigger names are not local to
tables, so the command is simply <literal>DROP TRIGGER
<replaceable>name</replaceable></literal>.
PostgreSQLのDROP TRIGGER文には標準SQLとの互換性がありません。
標準SQLでは、トリガ名がテーブルに局所化されていないので、DROP TRIGGER というコマンドが使われています。
name