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

DROP SEQUENCE

DROP SEQUENCE <refpurpose>remove a sequence</refpurpose> — シーケンスを削除する

概要

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

説明

<title>Description</title>

<command>DROP SEQUENCE</command> removes sequence number generators. A sequence can only be dropped by its owner or a superuser. DROP SEQUENCEはシーケンス番号ジェネレータを削除します。 シーケンスの削除はその所有者またはスーパーユーザのみが可能です。

パラメータ

<title>Parameters</title>
IF EXISTS

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

name

The name (optionally schema-qualified) of a sequence. シーケンスの名前です(スキーマ修飾名も可)。

CASCADE

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

RESTRICT

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

<title>Examples</title>

To remove the sequence <literal>serial</literal>: serialという名前のシーケンスを削除します。

DROP SEQUENCE serial;

互換性

<title>Compatibility</title>

<command>DROP SEQUENCE</command> conforms to the <acronym>SQL</acronym> standard, except that the standard only allows one sequence 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オプションを除き、DROP SEQUENCEは標準SQLに準拠します。

関連項目

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