summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane2007-10-24 23:27:08 +0000
committerTom Lane2007-10-24 23:27:08 +0000
commit048efc25e46d95f6a6dad20d65f6d9dd10c640d4 (patch)
tree62aa8e84ce59710b3317eb97926cfa86452d8bd0 /doc/src
parent8a35b07e1849c1af7acbdc8eea0bc357b5ad51e3 (diff)
Disallow scrolling of FOR UPDATE/FOR SHARE cursors, so as to avoid problems
in corner cases such as re-fetching a just-deleted row. We may be able to relax this someday, but let's find out how many people really care before we invest a lot of work in it. Per report from Heikki and subsequent discussion. While in the neighborhood, make the combination of INSENSITIVE and FOR UPDATE throw an error, since they are semantically incompatible. (Up to now we've accepted but just ignored the INSENSITIVE option of DECLARE CURSOR.)
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/declare.sgml16
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml
index f823cf77bbe..269d2c101c4 100644
--- a/doc/src/sgml/ref/declare.sgml
+++ b/doc/src/sgml/ref/declare.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/declare.sgml,v 1.41 2007/06/11 01:16:21 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/declare.sgml,v 1.42 2007/10/24 23:27:07 tgl Exp $
PostgreSQL documentation
-->
@@ -172,7 +172,7 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
transaction. Thus, <command>DECLARE</> without <literal>WITH
HOLD</literal> is useless outside a transaction block: the cursor would
survive only to the completion of the statement. Therefore
- <productname>PostgreSQL</productname> reports an error if this
+ <productname>PostgreSQL</productname> reports an error if such a
command is used outside a transaction block.
Use
<xref linkend="sql-begin" endterm="sql-begin-title">,
@@ -231,6 +231,11 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
</para>
<para>
+ <literal>SCROLL</literal> may not be specified when the query
+ includes <literal>FOR UPDATE</> or <literal>FOR SHARE</>.
+ </para>
+
+ <para>
The SQL standard only makes provisions for cursors in embedded
<acronym>SQL</acronym>. The <productname>PostgreSQL</productname>
server does not implement an <command>OPEN</command> statement for
@@ -265,10 +270,11 @@ DECLARE liahona CURSOR FOR SELECT * FROM films;
<title>Compatibility</title>
<para>
- The SQL standard specifies that by default, cursors are sensitive to
- concurrent updates of the underlying data. In
+ The SQL standard says that it is implementation-dependent whether cursors
+ are sensitive to concurrent updates of the underlying data by default. In
<productname>PostgreSQL</productname>, cursors are insensitive by default,
- and can be made sensitive by specifying <literal>FOR UPDATE</>.
+ and can be made sensitive by specifying <literal>FOR UPDATE</>. Other
+ products may work differently.
</para>
<para>