diff options
author | Neil Conway <neilc@samurai.com> | 2005-03-14 00:19:37 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2005-03-14 00:19:37 +0000 |
commit | c06965544188244efa703f6a97f3088a291d57b5 (patch) | |
tree | 3bb6f3068d418b4ef98828db4f856e852c02df20 /doc/src | |
parent | 41e2a80f570bf0e8e68d0eef7d1510e5ec32b3ae (diff) | |
download | postgresql-c06965544188244efa703f6a97f3088a291d57b5.tar.gz postgresql-c06965544188244efa703f6a97f3088a291d57b5.zip |
Allow ALTER FUNCTION to change a function's strictness, volatility, and
whether or not it is a security definer. Changing a function's strictness
is required by SQL2003, and the other capabilities make sense. Also, allow
an optional RESTRICT noise word to be specified, for SQL conformance.
Some trivial regression tests added and the documentation has been
updated.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/alter_function.sgml | 83 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_index.sgml | 8 |
2 files changed, 77 insertions, 14 deletions
diff --git a/doc/src/sgml/ref/alter_function.sgml b/doc/src/sgml/ref/alter_function.sgml index 00dfcac007a..468aa2b2e2e 100644 --- a/doc/src/sgml/ref/alter_function.sgml +++ b/doc/src/sgml/ref/alter_function.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.5 2004/06/25 21:55:50 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.6 2005/03/14 00:19:36 neilc Exp $ PostgreSQL documentation --> @@ -20,8 +20,15 @@ PostgreSQL documentation <refsynopsisdiv> <synopsis> +ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) <replaceable class="PARAMETER">action</replaceable> [, ... ] [ RESTRICT ] ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) RENAME TO <replaceable>newname</replaceable> ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) OWNER TO <replaceable>newowner</replaceable> + +where <replaceable class="PARAMETER">action</replaceable> is one of: + + CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT + IMMUTABLE | STABLE | VOLATILE + [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER </synopsis> </refsynopsisdiv> @@ -69,11 +76,65 @@ ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter <term><replaceable class="parameter">newowner</replaceable></term> <listitem> <para> - The new owner of the function. - To change the owner of a function, you must be a superuser. - Note that if the function is marked - <literal>SECURITY DEFINER</literal>, - it will subsequently execute as the new owner. + The new owner of the function. To change the owner of a + function, you must be a superuser. Note that if the function is + marked <literal>SECURITY DEFINER</literal>, it will subsequently + execute as the new owner. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal>CALLED ON NULL INPUT</literal></term> + <term><literal>RETURNS NULL ON NULL INPUT</literal></term> + <term><literal>STRICT</literal></term> + + <listitem> + <para> + <literal>CALLED ON NULL INPUT</literal> changes the function so + that it will be invoked when some or all of its arguments are + null. <literal>RETURNS NULL ON NULL INPUT</literal> or + <literal>STRICT</literal> changes the function so that it + always returns null if any of its arguments are null. See <xref + linkend="sql-createfunction"> for more information. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal>IMMUTABLE</literal></term> + <term><literal>STABLE</literal></term> + <term><literal>VOLATILE</literal></term> + + <listitem> + <para> + Change the volatility of the function to the specified + type. See <xref linkend="sql-createfunction"> for more + information about function volatility. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal><optional>EXTERNAL</optional> SECURITY INVOKER</literal></term> + <term><literal><optional>EXTERNAL</optional> SECURITY DEFINER</literal></term> + + <listitem> + <para> + Change whether the function is a security definer or not. The + key word <literal>EXTERNAL</literal> is ignored for SQL + conformance. See <xref linkend="sql-createfunction"> for more + information about this capability. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal>RESTRICT</literal></term> + + <listitem> + <para> + Ignored for conformance with the SQL standard. </para> </listitem> </varlistentry> @@ -104,9 +165,13 @@ ALTER FUNCTION sqrt(integer) OWNER TO joe; <title>Compatibility</title> <para> - There is an <command>ALTER FUNCTION</command> statement in the SQL - standard, but it does not provide the option to rename the - function or change the owner. + This statement is partially compatible with the <command>ALTER + FUNCTION</> statement in the SQL standard. The standard allows more + properties of a function to be modified, but does not provide the + ability to rename a function, make a function a security definer, + or change the owner or volatility of a function. The standard also + requires the <literal>RESTRICT</> key word; it is optional in + <productname>PostgreSQL</>. </para> </refsect1> diff --git a/doc/src/sgml/ref/alter_index.sgml b/doc/src/sgml/ref/alter_index.sgml index 4ce4a6871cf..7ea1f2e97a5 100644 --- a/doc/src/sgml/ref/alter_index.sgml +++ b/doc/src/sgml/ref/alter_index.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/alter_index.sgml,v 1.4 2004/08/24 00:06:51 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_index.sgml,v 1.5 2005/03/14 00:19:36 neilc Exp $ PostgreSQL documentation --> @@ -20,10 +20,8 @@ PostgreSQL documentation <refsynopsisdiv> <synopsis> -ALTER INDEX <replaceable class="PARAMETER">name</replaceable> - <replaceable class="PARAMETER">action</replaceable> [, ... ] -ALTER INDEX <replaceable class="PARAMETER">name</replaceable> - RENAME TO <replaceable class="PARAMETER">new_name</replaceable> +ALTER INDEX <replaceable class="PARAMETER">name</replaceable> <replaceable class="PARAMETER">action</replaceable> [, ... ] +ALTER INDEX <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable class="PARAMETER">new_name</replaceable> where <replaceable class="PARAMETER">action</replaceable> is one of: |