postgres.git / summary / log / commit / refs
commit f38d5a27373ff281f2eb62a156d058e57cfac96e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Jul 12 16:28:43 2018 +0000
First released in: 12.0, 9.3.24, 9.4.19, 9.5.14, 9.6.10, 10.5, 11.0
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.
Explain that you can use any integer expression for the "count" in
pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only
allow a constant.
Remove the duplicate version of this para under MOVE. I don't see
a good reason to maintain two identical paras when we just said that
MOVE works exactly like FETCH.
Per Pavel Stehule, though I didn't use his text.
Discussion: https://postgr.es/m/CAFj8pRAcvSXcNdUGx43bOK1e3NNPbQny7neoTLN42af+8MYWEA@mail.gmail.com
doc/src/sgml/plpgsql.sgml | 24 ++++--------------------
doc/src/sgml/ref/fetch.sgml | 2 +-
2 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index 159ff9d4b38..366179395f4 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -3153,6 +3153,10 @@ FETCH <optional> <replaceable>direction</replaceable> { FROM | IN } </optional>
<literal>BACKWARD</>.
Omitting <replaceable>direction</replaceable> is the same
as specifying <literal>NEXT</>.
+ In the forms using a <replaceable>count</replaceable>,
+ the <replaceable>count</replaceable> can be any integer-valued
+ expression (unlike the SQL <command>FETCH</command> command,
+ which only allows an integer constant).
<replaceable>direction</replaceable> values that require moving
backward are likely to fail unless the cursor was declared or opened
with the <literal>SCROLL</> option.
@@ -3190,26 +3194,6 @@ MOVE <optional> <replaceable>direction</replaceable> { FROM | IN } </optional> <
be checked to see whether there was a next row to move to.
</para>
- <para>
- The <replaceable>direction</replaceable> clause can be any of the
- variants allowed in the SQL <xref linkend="sql-fetch">
- command, namely
- <literal>NEXT</>,
- <literal>PRIOR</>,
- <literal>FIRST</>,
- <literal>LAST</>,
- <literal>ABSOLUTE</> <replaceable>count</replaceable>,
- <literal>RELATIVE</> <replaceable>count</replaceable>,
- <literal>ALL</>,
- <literal>FORWARD</> <optional> <replaceable>count</replaceable> | <literal>ALL</> </optional>, or
- <literal>BACKWARD</> <optional> <replaceable>count</replaceable> | <literal>ALL</> </optional>.
- Omitting <replaceable>direction</replaceable> is the same
- as specifying <literal>NEXT</>.
- <replaceable>direction</replaceable> values that require moving
- backward are likely to fail unless the cursor was declared or opened
- with the <literal>SCROLL</> option.
- </para>
-
<para>
Examples:
<programlisting>
diff --git a/doc/src/sgml/ref/fetch.sgml b/doc/src/sgml/ref/fetch.sgml
index 24c8c491569..d8784e537f0 100644
--- a/doc/src/sgml/ref/fetch.sgml
+++ b/doc/src/sgml/ref/fetch.sgml
@@ -99,7 +99,7 @@ FETCH [ <replaceable class="PARAMETER">direction</replaceable> [ FROM | IN ] ] <
This page describes usage of cursors at the SQL command level.
If you are trying to use cursors inside a <application>PL/pgSQL</>
function, the rules are different —
- see <xref linkend="plpgsql-cursors">.
+ see <xref linkend="plpgsql-cursor-using">.
</para>
</note>
</refsect1>
[parent: 98e2c298c2f5]