Skip to content

Commit 93532db

Browse files
committed
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
1 parent 11abea3 commit 93532db

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

doc/src/sgml/plpgsql.sgml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3173,6 +3173,10 @@ FETCH <optional> <replaceable>direction</replaceable> { FROM | IN } </optional>
31733173
<literal>BACKWARD</>.
31743174
Omitting <replaceable>direction</replaceable> is the same
31753175
as specifying <literal>NEXT</>.
3176+
In the forms using a <replaceable>count</replaceable>,
3177+
the <replaceable>count</replaceable> can be any integer-valued
3178+
expression (unlike the SQL <command>FETCH</command> command,
3179+
which only allows an integer constant).
31763180
<replaceable>direction</replaceable> values that require moving
31773181
backward are likely to fail unless the cursor was declared or opened
31783182
with the <literal>SCROLL</> option.
@@ -3210,26 +3214,6 @@ MOVE <optional> <replaceable>direction</replaceable> { FROM | IN } </optional> <
32103214
be checked to see whether there was a next row to move to.
32113215
</para>
32123216

3213-
<para>
3214-
The <replaceable>direction</replaceable> clause can be any of the
3215-
variants allowed in the SQL <xref linkend="sql-fetch">
3216-
command, namely
3217-
<literal>NEXT</>,
3218-
<literal>PRIOR</>,
3219-
<literal>FIRST</>,
3220-
<literal>LAST</>,
3221-
<literal>ABSOLUTE</> <replaceable>count</replaceable>,
3222-
<literal>RELATIVE</> <replaceable>count</replaceable>,
3223-
<literal>ALL</>,
3224-
<literal>FORWARD</> <optional> <replaceable>count</replaceable> | <literal>ALL</> </optional>, or
3225-
<literal>BACKWARD</> <optional> <replaceable>count</replaceable> | <literal>ALL</> </optional>.
3226-
Omitting <replaceable>direction</replaceable> is the same
3227-
as specifying <literal>NEXT</>.
3228-
<replaceable>direction</replaceable> values that require moving
3229-
backward are likely to fail unless the cursor was declared or opened
3230-
with the <literal>SCROLL</> option.
3231-
</para>
3232-
32333217
<para>
32343218
Examples:
32353219
<programlisting>

doc/src/sgml/ref/fetch.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ FETCH [ <replaceable class="PARAMETER">direction</replaceable> [ FROM | IN ] ] <
9999
This page describes usage of cursors at the SQL command level.
100100
If you are trying to use cursors inside a <application>PL/pgSQL</>
101101
function, the rules are different &mdash;
102-
see <xref linkend="plpgsql-cursors">.
102+
see <xref linkend="plpgsql-cursor-using">.
103103
</para>
104104
</note>
105105
</refsect1>

0 commit comments

Comments
 (0)