diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index c878373b5e2726b0ce525ab7796eebcbbcbb8af9..1bd160cd359d90c66db5a70edd1a7bcd71e6a29c 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -3173,6 +3173,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. @@ -3210,26 +3214,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 24c8c4915690b79a5c8a15469e82796b118783af..d8784e537f0f1d0f02da559279b464f7328ec222 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>