]> begriffs open source - ai-pg/blob - full-docs/txt/sql-alterroutine.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-alterroutine.txt
1
2 ALTER ROUTINE
3
4    ALTER ROUTINE — change the definition of a routine
5
6 Synopsis
7
8 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
9     action [ ... ] [ RESTRICT ]
10 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
11     RENAME TO new_name
12 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
13     OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
14 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
15     SET SCHEMA new_schema
16 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
17     [ NO ] DEPENDS ON EXTENSION extension_name
18
19 where action is one of:
20
21     IMMUTABLE | STABLE | VOLATILE
22     [ NOT ] LEAKPROOF
23     [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
24     PARALLEL { UNSAFE | RESTRICTED | SAFE }
25     COST execution_cost
26     ROWS result_rows
27     SET configuration_parameter { TO | = } { value | DEFAULT }
28     SET configuration_parameter FROM CURRENT
29     RESET configuration_parameter
30     RESET ALL
31
32 Description
33
34    ALTER ROUTINE changes the definition of a routine, which can be an
35    aggregate function, a normal function, or a procedure. See under ALTER
36    AGGREGATE, ALTER FUNCTION, and ALTER PROCEDURE for the description of
37    the parameters, more examples, and further details.
38
39 Examples
40
41    To rename the routine foo for type integer to foobar:
42 ALTER ROUTINE foo(integer) RENAME TO foobar;
43
44    This command will work independent of whether foo is an aggregate,
45    function, or procedure.
46
47 Compatibility
48
49    This statement is partially compatible with the ALTER ROUTINE statement
50    in the SQL standard. See under ALTER FUNCTION and ALTER PROCEDURE for
51    more details. Allowing routine names to refer to aggregate functions is
52    a PostgreSQL extension.
53
54 See Also
55
56    ALTER AGGREGATE, ALTER FUNCTION, ALTER PROCEDURE, DROP ROUTINE
57
58    Note that there is no CREATE ROUTINE command.