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

DROP VIEW

DROP VIEW <refpurpose>remove a view</refpurpose> — ビューを削除する

概要

DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

説明

<title>Description</title>

<command>DROP VIEW</command> drops an existing view. To execute this command you must be the owner of the view. DROP VIEWは既存のビューを削除します。 このコマンドを実行できるのは、ビューの所有者のみです。

パラメータ

<title>Parameters</title>
IF EXISTS

Do not throw an error if the view does not exist. A notice is issued in this case. ビューが存在しなかったとしてもエラーになりません。 この場合注意メッセージが発行されます。

name

The name (optionally schema-qualified) of the view to remove. 削除するビューの名前です(スキーマ修飾名も可)。

CASCADE

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

RESTRICT

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

<title>Examples</title>

This command will remove the view called <literal>kinds</literal>: 次のコマンドはkindsという名前のビューを削除します。

DROP VIEW kinds;

互換性

<title>Compatibility</title>

This command conforms to the SQL standard, except that the standard only allows one view to be dropped per command, and apart from the <literal>IF EXISTS</literal> option, which is a <productname>PostgreSQL</productname> extension. 標準では1コマンドで1つのビューのみを削除できるという点を除き、およびPostgreSQLの拡張であるIF EXISTSオプションを除き、このコマンドは標準SQLに従っています。

関連項目

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