DROP ROUTINE <refpurpose>remove a routine</refpurpose> — ルーチンを削除する
DROP ROUTINE [ IF EXISTS ]name[ ( [ [argmode] [argname]argtype[, ...] ] ) ] [, ...] [ CASCADE | RESTRICT ]
<command>DROP ROUTINE</command> removes the definition of one or more
existing routines. The term <quote>routine</quote> includes
aggregate functions, normal functions, and procedures. See
under <xref linkend="sql-dropaggregate"/>, <xref linkend="sql-dropfunction"/>,
and <xref linkend="sql-dropprocedure"/> for the description of the
parameters, more examples, and further details.
DROP ROUTINEは1つ以上の既存のルーチンを削除します。
用語「ルーチン」は、集約関数や通常の関数、プロシージャを含みます。
パラメータや例、さらなる詳細の説明はDROP AGGREGATEやDROP FUNCTION、DROP PROCEDUREを参照してください。
The lookup rules used by <command>DROP ROUTINE</command> are
fundamentally the same as for <command>DROP PROCEDURE</command>; in
particular, <command>DROP ROUTINE</command> shares that command's
behavior of considering an argument list that has
no <replaceable class="parameter">argmode</replaceable> markers to be
possibly using the SQL standard's definition that <literal>OUT</literal>
arguments are included in the list. (<command>DROP AGGREGATE</command>
and <command>DROP FUNCTION</command> do not do that.)
DROP ROUTINEにより使われている検索規則は基本的にはDROP PROCEDUREと同じです。特に、DROP ROUTINEは、argmodeの印のない引数リストを、OUT引数がそのリストに含まれているとする標準SQLの定義を使っているかもしれないと考慮するコマンドの振舞いを共有します。
(DROP AGGREGATEとDROP FUNCTIONはそのようなことをしません。)
In some cases where the same name is shared by routines of different
kinds, it is possible for <command>DROP ROUTINE</command> to fail with
an ambiguity error when a more specific command (<command>DROP
FUNCTION</command>, etc.) would work. Specifying the argument type
list more carefully will also resolve such problems.
種類の異なるルーチンで同じ名前が共有されている時には、より特定のコマンド(DROP FUNCTION等)では成功するものの、DROP ROUTINEでは曖昧なためのエラーで失敗する可能性があります。
引数の型のリストをより注意深く指定することでも、そのような問題を解決できるでしょう。
These lookup rules are also used by other commands that
act on existing routines, such as <command>ALTER ROUTINE</command>
and <command>COMMENT ON ROUTINE</command>.
ALTER ROUTINEやCOMMENT ON ROUTINEのような既存のルーチンに対して作用する他のコマンドでも、この検索規則は使われています。
To drop the routine <literal>foo</literal> for type
<type>integer</type>:
integer型に対するルーチンfooを削除します。
DROP ROUTINE foo(integer);
This command will work independent of whether <literal>foo</literal> is an
aggregate, function, or procedure.
このコマンドはfooが集約、関数、プロシージャの何れであるかによらず動作します。
This command conforms to the SQL standard, with these <productname>PostgreSQL</productname> extensions: このコマンドは標準SQLに準拠していますが、以下のPostgreSQLの拡張があります。
標準では1コマンドで1つのルーチンしか削除できません。
IF EXISTSオプションは拡張です。
引数のモードと名前を指定可能できるのは拡張であり、モードを指定した時の検索規則は異なります。
ユーザ定義可能な集約関数は拡張です。
Note that there is no <literal>CREATE ROUTINE</literal> command.
CREATE ROUTINEコマンドは無いことに注意してください。