Doc: improve description of plpgsql's FETCH and MOVE commands.
authorTom Lane <[email protected]>
Mon, 22 Jul 2024 23:43:12 +0000 (19:43 -0400)
committerTom Lane <[email protected]>
Mon, 22 Jul 2024 23:44:03 +0000 (19:44 -0400)
commit77b116724c7545fb610e0f7287d3fbff35ffea22
treeb9c7e8d9cc8c2bd0f1ece987472251ac65f9bc78
parentfeca6c688cd99c68ce10caf21f8566b2483ca3f2
Doc: improve description of plpgsql's FETCH and MOVE commands.

We were not being clear about which variants of the "direction"
clause are permitted in MOVE.  Also, the text seemed to be
written with only the FETCH/MOVE NEXT case in mind, so it
didn't apply very well to other variants.

Also, document that "MOVE count IN cursor" only works if count
is a constant.  This is not the whole truth, because some other
cases such as a parenthesized expression will also work, but
we want to push people to use "MOVE FORWARD count" instead.
The constant case is enough to cover what we allow in plain SQL,
and that seems sufficient to claim support for.

Update a comment in pl_gram.y claiming that we don't document
that point.

Per gripe from Philipp Salvisberg.

Discussion: https://postgr.es/m/172155553388.702.7932496598218792085@wrigleys.postgresql.org
doc/src/sgml/plpgsql.sgml
src/pl/plpgsql/src/pl_gram.y