aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-11-10 20:52:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-11-10 20:52:18 +0000
commit2c2faa17f2c48477763d3c2db39aac29eb2f4909 (patch)
tree30db6a9e9f0fdb82e98914bd1d3daeb2f23232b6
parent33556af7c7d3e10a8e04b24500bab65d4e24bfc9 (diff)
downloadpostgresql-2c2faa17f2c48477763d3c2db39aac29eb2f4909.tar.gz
postgresql-2c2faa17f2c48477763d3c2db39aac29eb2f4909.zip
Emphasize that immutable and stable functions are not allowed to modify
the database. xfunc.sgml was already pretty definite on the point, but it doesn't hurt to make it clear here too.
-rw-r--r--doc/src/sgml/ref/create_function.sgml15
1 files changed, 8 insertions, 7 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index 4b85072aaee..3381c1db996 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.69 2006/11/03 07:17:36 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.70 2006/11/10 20:52:18 tgl Exp $
-->
<refentry id="SQL-CREATEFUNCTION">
@@ -198,15 +198,15 @@ CREATE [ OR REPLACE ] FUNCTION
<listitem>
<para>
- These attributes inform the system whether it is safe to
- replace multiple evaluations of the function with a single
- evaluation, for run-time optimization. At most one choice
+ These attributes inform the query optimizer about the behavior
+ of the function. At most one choice
may be specified. If none of these appear,
<literal>VOLATILE</literal> is the default assumption.
</para>
<para>
- <literal>IMMUTABLE</literal> indicates that the function always
+ <literal>IMMUTABLE</literal> indicates that the function
+ cannot modify the database and always
returns the same result when given the same argument values; that
is, it does not do database lookups or otherwise use information not
directly present in its argument list. If this option is given,
@@ -215,8 +215,9 @@ CREATE [ OR REPLACE ] FUNCTION
</para>
<para>
- <literal>STABLE</literal> indicates that within a single table scan
- the function will consistently
+ <literal>STABLE</literal> indicates that the function
+ cannot modify the database,
+ and that within a single table scan it will consistently
return the same result for the same argument values, but that its
result could change across SQL statements. This is the appropriate
selection for functions whose results depend on database lookups,