summaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/declare.sgml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/ref/declare.sgml')
-rw-r--r--doc/src/sgml/ref/declare.sgml8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml
index d6177dcd9c4..951dfa982ba 100644
--- a/doc/src/sgml/ref/declare.sgml
+++ b/doc/src/sgml/ref/declare.sgml
@@ -228,12 +228,14 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
<caution>
<para>
- Scrollable and <literal>WITH HOLD</literal> cursors may give unexpected
+ Scrollable cursors may give unexpected
results if they invoke any volatile functions (see <xref
linkend="xfunc-volatility"/>). When a previously fetched row is
re-fetched, the functions might be re-executed, perhaps leading to
- results different from the first time. One workaround for such cases
- is to declare the cursor <literal>WITH HOLD</literal> and commit the
+ results different from the first time. It's best to
+ specify <literal>NO SCROLL</literal> for a query involving volatile
+ functions. If that is not practical, one workaround
+ is to declare the cursor <literal>SCROLL WITH HOLD</literal> and commit the
transaction before reading any rows from it. This will force the
entire output of the cursor to be materialized in temporary storage,
so that volatile functions are executed exactly once for each row.