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

ALTER ROUTINE

ALTER ROUTINE <refpurpose>change the definition of a routine</refpurpose> — ルーチンの定義を変更する

概要

ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    action [ ... ] [ RESTRICT ]
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    RENAME TO new_name
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    SET SCHEMA new_schema
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    [ NO ] DEPENDS ON EXTENSION extension_name


<phrase>where <replaceable class="parameter">action</replaceable> is one of:</phrase>

ここでactionは以下のいずれかです。

    IMMUTABLE | STABLE | VOLATILE
    [ NOT ] LEAKPROOF
    [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
    PARALLEL { UNSAFE | RESTRICTED | SAFE }
    COST execution_cost
    ROWS result_rows
    SET configuration_parameter { TO | = } { value | DEFAULT }
    SET configuration_parameter FROM CURRENT
    RESET configuration_parameter
    RESET ALL

説明

<title>Description</title>

<command>ALTER ROUTINE</command> changes the definition of a routine, which can be an aggregate function, a normal function, or a procedure. See under <xref linkend="sql-alteraggregate"/>, <xref linkend="sql-alterfunction"/>, and <xref linkend="sql-alterprocedure"/> for the description of the parameters, more examples, and further details. ALTER ROUTINEはルーチン、すなわち、集約関数や通常の関数、プロシージャの定義を変更します。 パラメータ説明や更なる例、より詳細については、ALTER AGGREGATEALTER FUNCTIONALTER PROCEDUREを参照してください。

<title>Examples</title>

To rename the routine <literal>foo</literal> for type <type>integer</type> to <literal>foobar</literal>: integer型に対するルーチンfoofoobarに名前変更します。

ALTER ROUTINE foo(integer) RENAME TO foobar;

This command will work independent of whether <literal>foo</literal> is an aggregate, function, or procedure. このコマンドはfooが集約、関数、プロシージャの何れであるかによらず動作します。

互換性

<title>Compatibility</title>

This statement is partially compatible with the <command>ALTER ROUTINE</command> statement in the SQL standard. See under <xref linkend="sql-alterfunction"/> and <xref linkend="sql-alterprocedure"/> for more details. Allowing routine names to refer to aggregate functions is a <productname>PostgreSQL</productname> extension. この文はSQL標準のALTER ROUTINE文と部分的に互換性があります。 より詳しくはALTER FUNCTIONALTER PROCEDUREを参照してください。 ルーチン名が集約関数を参照できるのはPostgreSQLの拡張です。

関連項目

<title>See Also</title> ALTER AGGREGATE, ALTER FUNCTION, ALTER PROCEDURE, DROP ROUTINE

Note that there is no <literal>CREATE ROUTINE</literal> command. CREATE ROUTINEコマンドは無いことに注意してください。