1ALTER ROUTINE(7) PostgreSQL 12.2 Documentation ALTER ROUTINE(7)
2
3
4
6 ALTER_ROUTINE - change the definition of a routine
7
9 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
10 action [ ... ] [ RESTRICT ]
11 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
12 RENAME TO new_name
13 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
14 OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
15 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
16 SET SCHEMA new_schema
17 ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
18 DEPENDS ON EXTENSION extension_name
19
20 where action is one of:
21
22 IMMUTABLE | STABLE | VOLATILE | [ 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
33 ALTER ROUTINE changes the definition of a routine, which can be an
34 aggregate function, a normal function, or a procedure. See under ALTER
35 AGGREGATE (ALTER_AGGREGATE(7)), ALTER FUNCTION (ALTER_FUNCTION(7)), and
36 ALTER PROCEDURE (ALTER_PROCEDURE(7)) for the description of the
37 parameters, more examples, and further details.
38
40 To rename the routine foo for type integer to foobar:
41
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
48 This statement is partially compatible with the ALTER ROUTINE statement
49 in the SQL standard. See under ALTER FUNCTION (ALTER_FUNCTION(7)) and
50 ALTER PROCEDURE (ALTER_PROCEDURE(7)) for more details. Allowing routine
51 names to refer to aggregate functions is a PostgreSQL extension.
52
54 ALTER AGGREGATE (ALTER_AGGREGATE(7)), ALTER FUNCTION
55 (ALTER_FUNCTION(7)), ALTER PROCEDURE (ALTER_PROCEDURE(7)), DROP ROUTINE
56 (DROP_ROUTINE(7))
57
58 Note that there is no CREATE ROUTINE command.
59
60
61
62PostgreSQL 12.2 2020 ALTER ROUTINE(7)