Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.
authorTom Lane
Thu, 12 Jul 2018 16:28:43 +0000 (12:28 -0400)
committerTom Lane
Thu, 12 Jul 2018 16:28:43 +0000 (12:28 -0400)
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

doc/src/sgml/plpgsql.sgml
doc/src/sgml/ref/fetch.sgml

index cc9993e609d39a87bcc94137ddc7a44bdcb0cb78..8daf1455f2a39e9eb197b391f89c50aa4e86e468 100644 (file)
@@ -3173,6 +3173,10 @@ FETCH  direction { FROM | IN } 
      BACKWARD.
      Omitting direction is the same
      as specifying NEXT.
+     In the forms using a count,
+     the count can be any integer-valued
+     expression (unlike the SQL FETCH command,
+     which only allows an integer constant).
      direction values that require moving
      backward are likely to fail unless the cursor was declared or opened
      with the SCROLL option.
@@ -3210,26 +3214,6 @@ MOVE  direction { FROM | IN }  <
      be checked to see whether there was a next row to move to.
     
 
-    
-     The direction clause can be any of the
-     variants allowed in the SQL 
-     command, namely
-     NEXT,
-     PRIOR,
-     FIRST,
-     LAST,
-     ABSOLUTE count,
-     RELATIVE count,
-     ALL,
-     FORWARD  count | ALL , or
-     BACKWARD  count | ALL .
-     Omitting direction is the same
-     as specifying NEXT.
-     direction values that require moving
-     backward are likely to fail unless the cursor was declared or opened
-     with the SCROLL option.
-    
-
     
      Examples:
 
index 24c8c4915690b79a5c8a15469e82796b118783af..d8784e537f0f1d0f02da559279b464f7328ec222 100644 (file)
@@ -99,7 +99,7 @@ FETCH [ direction [ FROM | IN ] ] <
     This page describes usage of cursors at the SQL command level.
     If you are trying to use cursors inside a PL/pgSQL
     function, the rules are different —
-    see s">.
+    see -using">.