2
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.5 2004-06-25 21:55:50 tgl Exp $
3
PostgreSQL documentation
6
<refentry id="SQL-ALTERFUNCTION">
8
<refentrytitle id="SQL-ALTERFUNCTION-TITLE">ALTER FUNCTION</refentrytitle>
9
<refmiscinfo>SQL - Language Statements</refmiscinfo>
13
<refname>ALTER FUNCTION</refname>
14
<refpurpose>change the definition of a function</refpurpose>
17
<indexterm zone="sql-alterfunction">
18
<primary>ALTER FUNCTION</primary>
23
ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) RENAME TO <replaceable>newname</replaceable>
24
ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) OWNER TO <replaceable>newowner</replaceable>
29
<title>Description</title>
32
<command>ALTER FUNCTION</command> changes the definition of a
38
<title>Parameters</title>
42
<term><replaceable class="parameter">name</replaceable></term>
45
The name (optionally schema-qualified) of an existing function.
51
<term><replaceable class="parameter">type</replaceable></term>
54
The data type of an argument of the function.
60
<term><replaceable class="parameter">newname</replaceable></term>
63
The new name of the function.
69
<term><replaceable class="parameter">newowner</replaceable></term>
72
The new owner of the function.
73
To change the owner of a function, you must be a superuser.
74
Note that if the function is marked
75
<literal>SECURITY DEFINER</literal>,
76
it will subsequently execute as the new owner.
84
<title>Examples</title>
87
To rename the function <literal>sqrt</literal> for type
88
<type>integer</type> to <literal>square_root</literal>:
90
ALTER FUNCTION sqrt(integer) RENAME TO square_root;
95
To change the owner of the function <literal>sqrt</literal> for type
96
<type>integer</type> to <literal>joe</literal>:
98
ALTER FUNCTION sqrt(integer) OWNER TO joe;
104
<title>Compatibility</title>
107
There is an <command>ALTER FUNCTION</command> statement in the SQL
108
standard, but it does not provide the option to rename the
109
function or change the owner.
114
<title>See Also</title>
116
<simplelist type="inline">
117
<member><xref linkend="sql-createfunction" endterm="sql-createfunction-title"></member>
118
<member><xref linkend="sql-dropfunction" endterm="sql-dropfunction-title"></member>
123
<!-- Keep this comment at the end of the file
128
sgml-minimize-attributes:nil
129
sgml-always-quote-attributes:t
132
sgml-parent-document:nil
133
sgml-default-dtd-file:"../reference.ced"
134
sgml-exposed-tags:nil
135
sgml-local-catalogs:"/usr/lib/sgml/catalog"
136
sgml-local-ecat-files:nil