PLpgSQL FETCH documentation is has ref on SQL FETCH command. SQL FETCH allows only int constants as count. PLpgSQL allows any expressions. In this case documentation is not clear, and people can be messy - and apply SQL FETCH limits on PLpgSQL FETCH.
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 5b2aac618e..b65cb11d00 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -3250,7 +3250,8 @@ MOVE <optional> <replaceable>direction</replaceable> { FROM | IN } </optional> < as specifying <literal>NEXT</literal>. <replaceable>direction</replaceable> values that require moving backward are likely to fail unless the cursor was declared or opened - with the <literal>SCROLL</literal> option. + with the <literal>SCROLL</literal> option. The <replaceable>count</replaceable> + can be any expressions with integer result or integer constant. </para>