Обсуждение: small doc fix - using expressions in plpgsql FETCH command
Hi
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.
I propose some small enhancing
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>
<para>
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>
<para>
Options, notes?
Regards
Pavel
Pavel Stehule <pavel.stehule@gmail.com> writes: > 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. Right. Pushed with some rewriting. regards, tom lane
2018-07-12 18:29 GMT+02:00 Tom Lane <tgl@sss.pgh.pa.us>:
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 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.
Right. Pushed with some rewriting.
Thank you
Pavel
regards, tom lane