summaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/create_function.sgml
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-11 00:06:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-11 00:06:42 +0000
commit82a47982f37077a9bfe67c0e9cc87b4f9b16e34b (patch)
treec9d600eddcc50bd7ff70061838bbdfcea8e68165 /doc/src/sgml/ref/create_function.sgml
parentb366562e43a8cd70bfb73efd8f5508608f92fd9b (diff)
Arrange for SET LOCAL's effects to persist until the end of the current top
transaction, unless rolled back or overridden by a SET clause for the same variable attached to a surrounding function call. Per discussion, these seem the best semantics. Note that this is an INCOMPATIBLE CHANGE: in 8.0 through 8.2, SET LOCAL's effects disappeared at subtransaction commit (leading to behavior that made little sense at the SQL level). I took advantage of the opportunity to rewrite and simplify the GUC variable save/restore logic a little bit. The old idea of a "tentative" value is gone; it was a hangover from before we had a stack. Also, we no longer need a stack entry for every nesting level, but only for those in which a variable's value actually changed.
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
-rw-r--r--doc/src/sgml/ref/create_function.sgml10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index b0cfe84db1c..8c542982d52 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.77 2007/09/03 18:46:29 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.78 2007/09/11 00:06:41 tgl Exp $
-->
<refentry id="SQL-CREATEFUNCTION">
@@ -475,11 +475,11 @@ CREATE FUNCTION foo(int, out text) ...
</para>
<para>
- If any <literal>SET</> clauses are attached to a function, then
+ If a <literal>SET</> clause is attached to a function, then
the effects of a <command>SET LOCAL</> command executed inside the
- function are restricted to the function: the configuration parameter's
- value is restored at function exit. This is true even for parameters
- not mentioned in the <literal>SET</> clause(s). However, an ordinary
+ function for the same variable are restricted to the function: the
+ configuration parameter's prior value is still restored at function exit.
+ However, an ordinary
<command>SET</> command (without <literal>LOCAL</>) overrides the
<literal>SET</> clause, much as it would do for a previous <command>SET
LOCAL</> command: the effects of such a command will persist after