~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/alter_function.sgml

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.5 2004-06-25 21:55:50 tgl Exp $
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
6
<refentry id="SQL-ALTERFUNCTION">
 
7
 <refmeta>
 
8
  <refentrytitle id="SQL-ALTERFUNCTION-TITLE">ALTER FUNCTION</refentrytitle>
 
9
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 
10
 </refmeta>
 
11
 
 
12
 <refnamediv>
 
13
  <refname>ALTER FUNCTION</refname>
 
14
  <refpurpose>change the definition of a function</refpurpose>
 
15
 </refnamediv>  
 
16
  
 
17
 <indexterm zone="sql-alterfunction">
 
18
  <primary>ALTER FUNCTION</primary>
 
19
 </indexterm>
 
20
 
 
21
 <refsynopsisdiv>
 
22
<synopsis>
 
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>
 
25
</synopsis>
 
26
 </refsynopsisdiv>
 
27
  
 
28
 <refsect1>
 
29
  <title>Description</title>
 
30
 
 
31
  <para>
 
32
   <command>ALTER FUNCTION</command> changes the definition of a
 
33
   function.
 
34
  </para>
 
35
 </refsect1>
 
36
  
 
37
 <refsect1>
 
38
  <title>Parameters</title>
 
39
 
 
40
  <variablelist>
 
41
   <varlistentry>
 
42
    <term><replaceable class="parameter">name</replaceable></term>
 
43
    <listitem>
 
44
     <para>
 
45
      The name (optionally schema-qualified) of an existing function.
 
46
     </para>
 
47
    </listitem>
 
48
   </varlistentry>
 
49
 
 
50
   <varlistentry>
 
51
    <term><replaceable class="parameter">type</replaceable></term>
 
52
    <listitem>
 
53
     <para>
 
54
      The data type of an argument of the function.
 
55
     </para>
 
56
    </listitem>
 
57
   </varlistentry>
 
58
 
 
59
   <varlistentry>
 
60
    <term><replaceable class="parameter">newname</replaceable></term>
 
61
    <listitem>
 
62
     <para>
 
63
      The new name of the function.
 
64
     </para>
 
65
    </listitem>
 
66
   </varlistentry>
 
67
 
 
68
   <varlistentry>
 
69
    <term><replaceable class="parameter">newowner</replaceable></term>
 
70
    <listitem>
 
71
     <para>
 
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.
 
77
     </para>
 
78
    </listitem>
 
79
   </varlistentry>
 
80
  </variablelist>
 
81
 </refsect1>
 
82
 
 
83
 <refsect1>
 
84
  <title>Examples</title>
 
85
 
 
86
  <para>
 
87
   To rename the function <literal>sqrt</literal> for type
 
88
   <type>integer</type> to <literal>square_root</literal>:
 
89
<programlisting>
 
90
ALTER FUNCTION sqrt(integer) RENAME TO square_root;
 
91
</programlisting>
 
92
  </para>
 
93
 
 
94
  <para>
 
95
   To change the owner of the function <literal>sqrt</literal> for type
 
96
   <type>integer</type> to <literal>joe</literal>:
 
97
<programlisting>
 
98
ALTER FUNCTION sqrt(integer) OWNER TO joe;
 
99
</programlisting>
 
100
  </para>
 
101
 </refsect1>
 
102
 
 
103
 <refsect1>
 
104
  <title>Compatibility</title>
 
105
 
 
106
  <para>
 
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.
 
110
  </para>
 
111
 </refsect1>
 
112
 
 
113
 <refsect1>
 
114
  <title>See Also</title>
 
115
 
 
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>
 
119
  </simplelist>
 
120
 </refsect1>
 
121
</refentry>
 
122
 
 
123
<!-- Keep this comment at the end of the file
 
124
Local variables:
 
125
mode: sgml
 
126
sgml-omittag:nil
 
127
sgml-shorttag:t
 
128
sgml-minimize-attributes:nil
 
129
sgml-always-quote-attributes:t
 
130
sgml-indent-step:1
 
131
sgml-indent-data: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
 
137
End:
 
138
-->