From: Tom Lane Date: Fri, 10 Nov 2006 20:52:18 +0000 (+0000) Subject: Emphasize that immutable and stable functions are not allowed to modify X-Git-Tag: REL8_2_RC1~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c2faa17f2c48477763d3c2db39aac29eb2f4909;p=postgresql 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. --- diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 4b85072aae..3381c1db99 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -1,5 +1,5 @@ @@ -198,15 +198,15 @@ CREATE [ OR REPLACE ] FUNCTION - 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, VOLATILE is the default assumption. - IMMUTABLE indicates that the function always + IMMUTABLE 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 - STABLE indicates that within a single table scan - the function will consistently + STABLE 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,