mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 03:21:24 +03:00
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
This commit is contained in:
parent
e8fe3bb230
commit
2e7a25c1dc
@ -3033,6 +3033,10 @@ FETCH <optional> <replaceable>direction</replaceable> { FROM | IN } </optional>
|
|||||||
<literal>BACKWARD</>.
|
<literal>BACKWARD</>.
|
||||||
Omitting <replaceable>direction</replaceable> is the same
|
Omitting <replaceable>direction</replaceable> is the same
|
||||||
as specifying <literal>NEXT</>.
|
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
|
<replaceable>direction</replaceable> values that require moving
|
||||||
backward are likely to fail unless the cursor was declared or opened
|
backward are likely to fail unless the cursor was declared or opened
|
||||||
with the <literal>SCROLL</> option.
|
with the <literal>SCROLL</> option.
|
||||||
@ -3070,26 +3074,6 @@ MOVE <optional> <replaceable>direction</replaceable> { FROM | IN } </optional> <
|
|||||||
be checked to see whether there was a next row to move to.
|
be checked to see whether there was a next row to move to.
|
||||||
</para>
|
</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>
|
<para>
|
||||||
Examples:
|
Examples:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
@ -99,7 +99,7 @@ FETCH [ <replaceable class="PARAMETER">direction</replaceable> [ FROM | IN ] ] <
|
|||||||
This page describes usage of cursors at the SQL command level.
|
This page describes usage of cursors at the SQL command level.
|
||||||
If you are trying to use cursors inside a <application>PL/pgSQL</>
|
If you are trying to use cursors inside a <application>PL/pgSQL</>
|
||||||
function, the rules are different —
|
function, the rules are different —
|
||||||
see <xref linkend="plpgsql-cursors">.
|
see <xref linkend="plpgsql-cursor-using">.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user