head	1.35;
access;
symbols
	REL9_0_0:1.35
	REL9_1_ALPHA1:1.35
	REL9_0_RC1:1.35
	REL9_0_BETA4:1.35
	REL9_0_STABLE:1.35.0.2
	REL9_0_BETA3:1.35
	REL9_0_BETA2:1.35
	REL7_4_29:1.25
	REL8_0_25:1.29
	REL8_1_21:1.29
	REL8_2_17:1.30
	REL8_3_11:1.30
	REL8_4_4:1.32
	REL9_0_BETA1:1.35
	REL9_0_ALPHA5_BRANCH:1.34.0.6
	REL9_0_ALPHA5:1.34
	REL7_4_28:1.25
	REL8_0_24:1.29
	REL8_1_20:1.29
	REL8_2_16:1.30
	REL8_3_10:1.30
	REL8_4_3:1.32
	REL9_0_ALPHA4:1.34
	REL9_0_ALPHA4_BRANCH:1.34.0.4
	REL8_5_ALPHA3:1.34
	REL8_5_ALPHA3_BRANCH:1.34.0.2
	REL7_4_27:1.25
	REL8_0_23:1.29
	REL8_1_19:1.29
	REL8_2_15:1.30
	REL8_3_9:1.30
	REL8_4_2:1.32
	REL8_5_ALPHA2:1.33
	REL8_5_ALPHA2_BRANCH:1.33.0.2
	REL7_4_26:1.25
	REL8_0_22:1.29
	REL8_1_18:1.29
	REL8_2_14:1.30
	REL8_3_8:1.30
	REL8_4_1:1.32
	REL8_5_ALPHA1:1.32
	REL8_5_ALPHA1_BRANCH:1.32.0.4
	REL8_4_STABLE:1.32.0.2
	REL8_4_0:1.32
	REL8_4_RC2:1.32
	REL8_4_RC1:1.31
	REL8_4_BETA2:1.31
	REL8_4_BETA1:1.31
	REL7_4_25:1.25
	REL8_0_21:1.29
	REL8_1_17:1.29
	REL8_2_13:1.30
	REL8_3_7:1.30
	REL7_4_24:1.25
	REL8_0_20:1.29
	REL8_1_16:1.29
	REL8_2_12:1.30
	REL8_3_6:1.30
	REL7_4_23:1.25
	REL8_0_19:1.29
	REL8_1_15:1.29
	REL8_2_11:1.30
	REL8_3_5:1.30
	REL7_4_22:1.25
	REL8_0_18:1.29
	REL8_1_14:1.29
	REL8_2_10:1.30
	REL8_3_4:1.30
	REL7_4_21:1.25
	REL8_0_17:1.29
	REL8_1_13:1.29
	REL8_2_9:1.30
	REL8_3_3:1.30
	REL7_4_20:1.25
	REL8_0_16:1.29
	REL8_1_12:1.29
	REL8_2_8:1.30
	REL8_3_2:1.30
	REL8_2_7:1.30
	REL8_3_1:1.30
	REL8_3_STABLE:1.30.0.4
	REL8_3_0:1.30
	REL8_3_RC2:1.30
	REL7_3_21:1.13
	REL7_4_19:1.25
	REL8_0_15:1.29
	REL8_1_11:1.29
	REL8_2_6:1.30
	REL8_3_RC1:1.30
	REL8_3_BETA4:1.30
	REL8_3_BETA3:1.30
	REL8_3_BETA2:1.30
	REL8_3_BETA1:1.30
	REL7_3_20:1.13
	REL7_4_18:1.25
	REL8_0_14:1.29
	REL8_1_10:1.29
	REL8_2_5:1.30
	REL7_3_19:1.13
	REL7_4_17:1.25
	REL8_0_13:1.29
	REL8_1_9:1.29
	REL8_2_4:1.30
	REL8_0_12:1.29
	REL8_1_8:1.29
	REL8_2_3:1.30
	REL7_3_18:1.13
	REL7_4_16:1.25
	REL8_0_11:1.29
	REL8_1_7:1.29
	REL8_2_2:1.30
	REL8_0_10:1.29
	REL8_1_6:1.29
	REL8_2_1:1.30
	REL7_4_15:1.25
	REL7_3_17:1.13
	REL8_2_STABLE:1.30.0.2
	REL8_2_0:1.30
	REL8_2_RC1:1.30
	REL8_2_BETA3:1.30
	REL8_2_BETA2:1.30
	REL8_1_5:1.29
	REL8_0_9:1.29
	REL7_4_14:1.25
	REL7_3_16:1.13
	REL8_2_BETA1:1.30
	REL7_3_15:1.13
	REL7_4_13:1.25
	REL8_0_8:1.29
	REL8_1_4:1.29
	REL7_3_14:1.13
	REL7_4_12:1.25
	REL8_0_7:1.29
	REL8_1_3:1.29
	REL7_3_13:1.13
	REL7_4_11:1.25
	REL8_0_6:1.29
	REL8_1_2:1.29
	REL7_3_12:1.13
	REL7_4_10:1.25
	REL8_0_5:1.29
	REL8_1_1:1.29
	REL8_1_STABLE:1.29.0.6
	REL8_1_0:1.29
	REL8_1_0RC1:1.29
	REL8_1_0BETA4:1.29
	REL8_1_0BETA3:1.29
	REL7_3_11:1.13
	REL7_4_9:1.25
	REL8_0_4:1.29
	REL8_1_0BETA2:1.29
	REL8_1_0BETA1:1.29
	REL7_2_8:1.12
	REL7_3_10:1.13
	REL7_4_8:1.25
	REL8_0_3:1.29
	REL8_0_2:1.29
	REL7_2_7:1.12
	REL7_3_9:1.13
	REL7_4_7:1.25
	REL8_0_1:1.29
	REL8_0_STABLE:1.29.0.4
	REL8_0_0:1.29.0.2
	REL8_0_0RC5:1.29
	REL8_0_0RC4:1.29
	REL8_0_0RC3:1.28
	REL8_0_0RC2:1.28
	REL8_0_0RC1:1.28
	REL8_0_0BETA5:1.28
	REL8_0_0BETA4:1.28
	REL7_4_6:1.25
	REL7_3_8:1.13
	REL7_2_6:1.12
	REL8_0_0BETA3:1.28
	REL8_0_0BETA2:1.28
	REL7_2_5:1.12
	REL7_4_5:1.25
	REL7_3_7:1.13
	REL7_4_4:1.25
	REL8_0_0BETA1:1.28
	REL7_4_3:1.25
	REL7_4_2:1.25
	REL7_3_6:1.13
	REL7_4_1:1.25
	REL7_3_5:1.13
	REL7_4:1.25
	REL7_4_RC2:1.25
	REL7_4_STABLE:1.25.0.2
	REL7_4_RC1:1.25
	REL7_4_BETA5:1.25
	REL7_4_BETA4:1.25
	REL7_4_BETA3:1.24
	REL7_4_BETA2:1.22
	WIN32_DEV:1.22.0.2
	REL7_4_BETA1:1.22
	REL7_3_4:1.13
	REL7_3_2:1.13
	REL7_2_4:1.12
	REL7_3_STABLE:1.13.0.2
	REL7_2_3:1.12
	REL7_2_STABLE:1.12.0.2
	REL7_2:1.12
	REL7_2_RC2:1.12
	REL7_2_RC1:1.12
	REL7_2_BETA5:1.12
	REL7_2_BETA4:1.12
	REL7_2_BETA3:1.11
	REL7_2_BETA2:1.11
	REL7_2_BETA1:1.11
	REL7_1_2:1.10
	REL7_1_STABLE:1.10.0.2
	REL7_1_BETA:1.9
	REL7_1_BETA3:1.10
	REL7_1_BETA2:1.10
	REL7_1:1.10
	REL7_0_PATCHES:1.9.0.2
	REL7_0:1.8
	REL6_5_PATCHES:1.5.0.2
	REL6_5:1.5
	REL6_4:1.3.0.2;
locks; strict;
comment	@# @;


1.35
date	2010.04.03.07.23.01;	author petere;	state Exp;
branches;
next	1.34;

1.34
date	2009.11.11.20.07.57;	author alvherre;	state Exp;
branches;
next	1.33;

1.33
date	2009.09.19.10.23.27;	author petere;	state Exp;
branches;
next	1.32;

1.32
date	2009.06.22.07.12.50;	author petere;	state Exp;
branches;
next	1.31;

1.31
date	2008.11.14.10.22.47;	author petere;	state Exp;
branches;
next	1.30;

1.30
date	2006.09.16.00.30.19;	author momjian;	state Exp;
branches;
next	1.29;

1.29
date	2005.01.04.00.39.53;	author tgl;	state Exp;
branches;
next	1.28;

1.28
date	2004.06.17.12.41.02;	author momjian;	state Exp;
branches;
next	1.27;

1.27
date	2004.03.23.22.39.22;	author tgl;	state Exp;
branches;
next	1.26;

1.26
date	2003.11.29.19.51.39;	author pgsql;	state Exp;
branches;
next	1.25;

1.25
date	2003.09.22.00.16.58;	author petere;	state Exp;
branches;
next	1.24;

1.24
date	2003.09.12.00.12.47;	author tgl;	state Exp;
branches;
next	1.23;

1.23
date	2003.08.31.17.32.23;	author petere;	state Exp;
branches;
next	1.22;

1.22
date	2003.05.04.02.23.16;	author petere;	state Exp;
branches
	1.22.2.1;
next	1.21;

1.21
date	2003.03.27.16.51.27;	author momjian;	state Exp;
branches;
next	1.20;

1.20
date	2003.03.11.19.40.22;	author tgl;	state Exp;
branches;
next	1.19;

1.19
date	2003.03.10.03.53.49;	author tgl;	state Exp;
branches;
next	1.18;

1.18
date	2003.02.04.11.23.58;	author momjian;	state Exp;
branches;
next	1.17;

1.17
date	2003.02.03.14.04.24;	author momjian;	state Exp;
branches;
next	1.16;

1.16
date	2003.01.08.00.22.26;	author tgl;	state Exp;
branches;
next	1.15;

1.15
date	2002.12.30.15.31.47;	author momjian;	state Exp;
branches;
next	1.14;

1.14
date	2002.11.13.00.44.08;	author momjian;	state Exp;
branches;
next	1.13;

1.13
date	2002.04.21.19.02.39;	author thomas;	state Exp;
branches;
next	1.12;

1.12
date	2001.12.08.03.24.37;	author thomas;	state Exp;
branches;
next	1.11;

1.11
date	2001.09.03.12.57.50;	author petere;	state Exp;
branches;
next	1.10;

1.10
date	2000.12.25.23.15.26;	author petere;	state Exp;
branches;
next	1.9;

1.9
date	2000.05.11.17.32.33;	author momjian;	state Exp;
branches;
next	1.8;

1.8
date	2000.04.04.19.42.36;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	2000.03.26.18.32.27;	author petere;	state Exp;
branches;
next	1.6;

1.6
date	99.07.22.15.09.13;	author thomas;	state Exp;
branches;
next	1.5;

1.5
date	99.07.06.17.16.40;	author thomas;	state Exp;
branches;
next	1.4;

1.4
date	98.12.29.02.24.44;	author thomas;	state Exp;
branches;
next	1.3;

1.3
date	98.09.25.13.42.36;	author thomas;	state Exp;
branches;
next	1.2;

1.2
date	98.09.07.15.56.17;	author thomas;	state Exp;
branches;
next	1.1;

1.1
date	98.09.02.03.01.01;	author thomas;	state Exp;
branches;
next	;

1.22.2.1
date	2003.09.07.04.36.45;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.35
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.34 2009/11/11 20:07:57 alvherre Exp $
PostgreSQL documentation
-->

<refentry id="SQL-MOVE">
 <refmeta>
  <refentrytitle>MOVE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>MOVE</refname>
  <refpurpose>position a cursor</refpurpose>
 </refnamediv>

 <indexterm zone="sql-move">
  <primary>MOVE</primary>
 </indexterm>

 <indexterm zone="sql-move">
  <primary>cursor</primary>
  <secondary>MOVE</secondary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
MOVE [ <replaceable class="PARAMETER">direction</replaceable> [ FROM | IN ] ] <replaceable class="PARAMETER">cursor_name</replaceable>
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>MOVE</command> repositions a cursor without retrieving any data.
   <command>MOVE</command> works exactly like the <command>FETCH</command>
   command, except it only positions the cursor and does not return rows.
  </para>

  <para>
   The parameters for the <command>MOVE</command> command are identical to 
   those of the <command>FETCH</command> command; refer to
   <xref linkend="sql-fetch">
   for details on syntax and usage.
  </para>
 </refsect1>

 <refsect1>
  <title>Outputs</title>

  <para>
   On successful completion, a <command>MOVE</> command returns a command
   tag of the form
<screen>
MOVE <replaceable class="parameter">count</replaceable>
</screen>
   The <replaceable class="parameter">count</replaceable> is the number
   of rows that a <command>FETCH</command> command with the same parameters
   would have returned (possibly zero).
  </para>
 </refsect1>

 <refsect1>
  <title>Examples</title>

<programlisting>
BEGIN WORK;
DECLARE liahona CURSOR FOR SELECT * FROM films;

-- Skip the first 5 rows:
MOVE FORWARD 5 IN liahona;
MOVE 5

-- Fetch the 6th row from the cursor liahona:
FETCH 1 FROM liahona;
 code  | title  | did | date_prod  |  kind  |  len
-------+--------+-----+------------+--------+-------
 P_303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37
(1 row)

-- Close the cursor liahona and end the transaction:
CLOSE liahona;
COMMIT WORK;
</programlisting>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   There is no <command>MOVE</command> statement in the SQL standard.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-close"></member>
   <member><xref linkend="sql-declare"></member>
   <member><xref linkend="sql-fetch"></member>
  </simplelist>
 </refsect1>
</refentry>
@


1.34
log
@Document the previous FETCH and MOVE changes.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.33 2009/09/19 10:23:27 petere Exp $
d8 1
a8 1
  <refentrytitle id="SQL-MOVE-TITLE">MOVE</refentrytitle>
d45 1
a45 1
   <xref linkend="sql-fetch" endterm="sql-fetch-title">
d101 3
a103 3
   <member><xref linkend="sql-close" endterm="sql-close-title"></member>
   <member><xref linkend="sql-declare" endterm="sql-declare-title"></member>
   <member><xref linkend="sql-fetch" endterm="sql-fetch-title"></member>
@


1.33
log
@Make the placeholder naming in the synopses of the SQL help more consistent
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.32 2009/06/22 07:12:50 petere Exp $
d29 1
a29 1
MOVE [ <replaceable class="PARAMETER">direction</replaceable> { FROM | IN } ] <replaceable class="PARAMETER">cursor_name</replaceable>
@


1.32
log
@Add more explicit note that the parameters of MOVE are identical to FETCH.

per David Wheeler
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.31 2008/11/14 10:22:47 petere Exp $
d29 1
a29 1
MOVE [ <replaceable class="PARAMETER">direction</replaceable> { FROM | IN } ] <replaceable class="PARAMETER">cursorname</replaceable>
@


1.31
log
@Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.30 2006/09/16 00:30:19 momjian Exp $
d43 2
a44 1
   Refer to 
@


1.30
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.29 2005/01/04 00:39:53 tgl Exp $
d9 1
@


1.29
log
@More minor updates and copy-editing.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/move.sgml,v 1.28 2004/06/17 12:41:02 momjian Exp $
a104 17

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
@


1.28
log
@The attached patch adds some index entries pointing to the cursor
reference pages.  Please apply.

Alvaro Herrera
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/move.sgml,v 1.27 2004/03/23 22:39:22 tgl Exp $
d89 1
a89 1
	
d94 10
@


1.27
log
@Repair misleading description of MOVE's command tag result.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/move.sgml,v 1.26 2003/11/29 19:51:39 pgsql Exp $
d19 5
@


1.26
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.25 2003/09/22 00:16:58 petere Exp $
d53 2
a54 1
   of rows moved over (possibly zero).
@


1.25
log
@Make the SQL command synopses appear less random.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.24 2003/09/12 00:12:47 tgl Exp $
@


1.24
log
@More cleanup of Diagnostics sections.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.23 2003/08/31 17:32:23 petere Exp $
d14 1
a14 1
  <refpurpose>reposition a cursor</refpurpose>
d23 1
a23 1
MOVE [ <replaceable class="PARAMETER">direction</replaceable> { FROM | IN } ] <replaceable class="PARAMETER">cursor</replaceable>
d33 1
a33 1
   command, except it only repositions the cursor and does not return rows.
@


1.23
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.22 2003/05/04 02:23:16 petere Exp $
d44 1
a44 1
  <title>Diagnostics</title>
d47 7
a53 3
   The count returned in <command>MOVE</command>'s status string is
   the count of the number of rows that would have been returned by
   the equivalent <command>FETCH</command> command.
@


1.22
log
@Last round of reference page editing.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.21 2003/03/27 16:51:27 momjian Exp $
d16 4
@


1.22.2.1
log
@Update this branch to match CVS head, includes WIN32 improvements.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.23 2003/08/31 17:32:23 petere Exp $
a15 4

 <indexterm zone="sql-move">
  <primary>MOVE</primary>
 </indexterm>
@


1.21
log
@This patch implements holdable cursors, following the proposal
(materialization into a tuple store) discussed on pgsql-hackers earlier.
I've updated the documentation and the regression tests.

Notes on the implementation:

- I needed to change the tuple store API slightly -- it assumes that it
won't be used to hold data across transaction boundaries, so the temp
files that it uses for on-disk storage are automatically reclaimed at
end-of-transaction. I added a flag to tuplestore_begin_heap() to control
this behavior. Is changing the tuple store API in this fashion OK?

- in order to store executor results in a tuple store, I added a new
CommandDest. This works well for the most part, with one exception: the
current DestFunction API doesn't provide enough information to allow the
Executor to store results into an arbitrary tuple store (where the
particular tuple store to use is chosen by the call site of
ExecutorRun). To workaround this, I've temporarily hacked up a solution
that works, but is not ideal: since the receiveTuple DestFunction is
passed the portal name, we can use that to lookup the Portal data
structure for the cursor and then use that to get at the tuple store the
Portal is using. This unnecessarily ties the Portal code with the
tupleReceiver code, but it works...

The proper fix for this is probably to change the DestFunction API --
Tom suggested passing the full QueryDesc to the receiveTuple function.
In that case, callers of ExecutorRun could "subclass" QueryDesc to add
any additional fields that their particular CommandDest needed to get
access to. This approach would work, but I'd like to think about it for
a little bit longer before deciding which route to go. In the mean time,
the code works fine, so I don't think a fix is urgent.

- (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and
adjusted the behavior of SCROLL in accordance with the discussion on
-hackers.

- (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml

Neil Conway
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.20 2003/03/11 19:40:22 tgl Exp $
d11 1
d13 4
a16 7
  <refname>
   MOVE
  </refname>
  <refpurpose>
   reposition a cursor
  </refpurpose>
 </refnamediv>                
d18 1
a18 4
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
  <synopsis>
d20 1
a20 1
  </synopsis>
d23 3
a25 7
 <refsect1 id="R1-SQL-MOVE-1">
  <refsect1info>
   <date>1998-09-24</date>
  </refsect1info>
  <title>
   Description
  </title>
d31 1
d37 4
d42 5
a46 23
  <refsect2 id="R2-SQL-MOVE-3">
   <refsect2info>
    <date>1998-09-24</date>
   </refsect2info>
   <title>
    Notes
   </title>

   <para>
    The count returned in <command>MOVE</command>'s status string is the
    count of the number of rows that would have been returned by the
    equivalent <command>FETCH</command> command.
   </para>

   <para>
    Refer to
    <xref linkend="sql-fetch" endterm="sql-fetch-title">
    for a description of valid arguments.
    Refer to 
    <xref linkend="sql-declare" endterm="sql-declare-title">
    to define a cursor.
   </para>
  </refsect2>
d49 2
a50 6
 <refsect1 id="R1-SQL-MOVE-2">
  <title>
   Usage
  </title>
  <para>
   Set up and use a cursor:
d55 2
a56 1
-- Skip first 5 rows:
a57 1
<computeroutput>
d59 6
a64 7
</computeroutput>
-- Fetch 6th row in the cursor liahona:
FETCH 1 IN liahona;
<computeroutput>
 code  | title  | did | date_prod | kind   | len
-------+--------+-----+-----------+--------+-------
 P_303 | 48 Hrs | 103 | 1982-10-22| Action | 01:37
d66 2
a67 2
</computeroutput>
-- close the cursor liahona and commit work:
a70 1
  </para>
d73 2
a74 4
 <refsect1 id="R1-SQL-MOVE-3">
  <title>
   Compatibility
  </title>
d76 3
a78 11
  <refsect2 id="R2-SQL-MOVE-4">
   <refsect2info>
    <date>1998-09-01</date>
   </refsect2info>
   <title>
    SQL92
   </title>
   <para>
    There is no <acronym>SQL92</acronym> <command>MOVE</command> statement. 
   </para>
  </refsect2>
@


1.20
log
@Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options
for FETCH and MOVE.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.19 2003/03/10 03:53:49 tgl Exp $
a66 6
    Refer to 
    <xref linkend="sql-begin" endterm="sql-begin-title">, 
    <xref linkend="sql-commit" endterm="sql-commit-title">,
    and
    <xref linkend="sql-rollback" endterm="sql-rollback-title">
    for further information about transactions.
d80 1
a80 1
DECLARE liahona CURSOR  FOR SELECT * FROM films;
@


1.19
log
@Restructure parsetree representation of DECLARE CURSOR: now it's a
utility statement (DeclareCursorStmt) with a SELECT query dangling from
it, rather than a SELECT query with a few unusual fields in it.  Add
code to determine whether a planned query can safely be run backwards.
If DECLARE CURSOR specifies SCROLL, ensure that the plan can be run
backwards by adding a Materialize plan node if it can't.  Without SCROLL,
you get an error if you try to fetch backwards from a cursor that can't
handle it.  (There is still some discussion about what the exact
behavior should be, but this is necessary infrastructure in any case.)
Along the way, make EXPLAIN DECLARE CURSOR work.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.18 2003/02/04 11:23:58 momjian Exp $
d24 1
a24 1
MOVE [ <replaceable class="PARAMETER">direction</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ] { IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
d36 1
a36 3
   <command>MOVE</command> allows the user to move the cursor position a 
   specified number of rows, or to the beginning or end of the cursor.
   <command>MOVE ALL</command> moves to the end of the cursor.
d55 3
a57 2
    <command>MOVE</command> is a <productname>PostgreSQL</productname>
    language extension.
a120 3
    Instead, <acronym>SQL92</acronym> allows
    one to <command>FETCH</command> rows from an absolute cursor position,
    implicitly moving the cursor to the correct position.
@


1.18
log
@Revert doc change so we mention moving past the last row of a cursor.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.17 2003/02/03 14:04:24 momjian Exp $
d91 1
a91 1
MOVE
a95 2
FETCH

@


1.17
log
@Change MOVE LAST to MOVE ALL.

Standard says FETCH LAST is after last row, and we don't do that.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.16 2003/01/08 00:22:26 tgl Exp $
d38 1
a38 1
   <command>MOVE ALL</command> moves to the last row of the cursor.
@


1.16
log
@Code review for FETCH/MOVE 0 changes.  Improve documentation, do the
right thing with the destination when FETCH 0 can't return a row,
don't try to stuff LONG_MAX into an int value.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.15 2002/12/30 15:31:47 momjian Exp $
d37 2
a38 1
   specified number of rows, or all the way to the end or start of the query.
@


1.15
log
@Cause FETCH 1 to return the current cursor row, or zero if at
beginning/end of cursor.

Have MOVE return 0/1 depending on cursor position.

Matches SQL spec.

Pass cursor counter from parser as a long rather than int.

Doc updates.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.14 2002/11/13 00:44:08 momjian Exp $
d16 1
a16 1
   position a cursor on a specified row of a table
d24 1
a24 3
MOVE [ <replaceable class="PARAMETER">direction</replaceable> ] 
    {<replaceable class="PARAMETER">count</replaceable> | LAST }
    { IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
d36 4
a39 6
   <command>MOVE</command> allows a user to move the cursor position a 
   specified number of rows.
   <command>MOVE</command> works like the <command>FETCH</command> command,
   but only positions the cursor and does not return rows.
   <replaceable class="PARAMETER">LAST</replaceable> moves to the end
   of the cursor.
@


1.14
log
@Make MOVE/FETCH 0 actually move/fetch 0.  Add MOVE LAST to move to end
of cursor.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/move.sgml,v 1.13 2002/04/21 19:02:39 thomas Exp $
d38 2
a39 2
   <command>MOVE</command> allows a user to move cursor position a specified
   number of rows.
@


1.13
log
@Augment the date/time examples in the User's Guide to reflect the newer
 capabilities of specifying time zones as intervals per SQL9x.
Put refentrytitle contents on the same line as the tag.
 Otherwise, leading whitespace is propagated into the product, which
 (at least) messes up the ToC layout.
Remove (some) docinfo tags containing dates. Best to omit if the dates
 are not accurate; maybe use CVS dates instead or leave them out.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.12 2001/12/08 03:24:37 thomas Exp $
d24 2
a25 1
MOVE [ <replaceable class="PARAMETER">direction</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ] 
d41 3
a43 2
   but only positions the cursor and does
   not return rows.
@


1.12
log
@Use PostgreSQL consistantly throughout docs. Before, usage was split evenly
 between Postgres and PostgreSQL.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.11 2001/09/03 12:57:50 petere Exp $
d8 1
a8 3
  <refentrytitle id="SQL-MOVE-TITLE">
   MOVE
  </refentrytitle>
@


1.11
log
@Put some kind of grammatical uniformity in the <refpurpose> lines.
@
text
@d2 2
a3 2
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.10 2000/12/25 23:15:26 petere Exp $
Postgres documentation
d60 1
a60 1
    <command>MOVE</command> is a <productname>Postgres</productname>
@


1.10
log
@Refine some things to create better looking man pages.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.9 2000/05/11 17:32:33 momjian Exp $
d18 1
a18 1
   Moves cursor position
@


1.9
log
@Update SGML for FETCH and url's.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.8 2000/04/04 19:42:36 momjian Exp $
d47 1
a47 1
   <xref linkend="sql-fetch-title" endterm="sql-fetch-title">
d66 1
a66 1
    <xref linkend="sql-fetch-title" endterm="sql-fetch-title">
d69 1
a69 1
    <xref linkend="sql-declare-title" endterm="sql-declare-title">
d72 2
a73 2
    <xref linkend="sql-begin-title" endterm="sql-begin-title">, 
    <xref linkend="sql-commit-title" endterm="sql-commit-title">,
d75 1
a75 1
    <xref linkend="sql-rollback-title" endterm="sql-rollback-title">
@


1.8
log
@Remove FETCH syntax heading from MOVE manual page.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.7 2000/03/26 18:32:27 petere Exp $
d26 1
a26 1
MOVE [ <replaceable class="PARAMETER">selector</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ] 
@


1.7
log
@Updated user's guide to match new psql's output format
Fixed bug in createdb/alternative location
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.6 1999/07/22 15:09:13 thomas Exp $
a27 1
    FETCH [ RELATIVE ] [ { [ <replaceable class="PARAMETER">#</replaceable> | ALL | NEXT | PRIOR ] } ] FROM ] <replaceable class="PARAMETER">cursor</replaceable>
@


1.6
log
@Complete merge of all old man page information.
ecpg reference page still needs formatting.
@
text
@d2 1
a2 1
$Header$
d89 1
a89 1
   <programlisting>
d92 1
a92 1
--Skip first 5 rows:
d97 1
a97 1
--Fetch 6th row in the cursor liahona:
d102 4
a105 4
  code |title |did| date_prod|kind      |len
  -----+------+---+----------+----------+------
  P_303|48 Hrs|103|1982-10-22|Action    | 01:37
  (1 row)
d110 1
a110 1
   </programlisting>
@


1.5
log
@Fix markup for docbook2man man page generation.
No big deal; fixed lots of other markup at the same time.
Bigest change: make sure there is no whitespace
 in front of <term> contents.
This will probably help the other output types too.
@
text
@d1 5
d8 1
a8 1
  <refentrytitle>
d23 1
a23 1
   <date>1998-09-24</date>
d47 3
a49 1
   Refer to the <command>FETCH</command> command for details on syntax and usage.
d59 1
d64 1
d66 11
a76 5
    Refer to <command>FETCH</command> for a description
    of valid arguments.
    Refer to <command>DECLARE</command> to declare a cursor.
    Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
    <command>ROLLBACK WORK</command> statements
a117 2
  <para>
  </para>
d127 1
a127 1
    There is no SQL92 <command>MOVE</command> statement. 
d130 1
a130 1
    implicitly moving the cursor to the correct place.
@


1.4
log
@Clean up to ensure tag completion as required by the newest versions
 of Norm's Modular Style Sheets and jade/docbook.
From Vince Vielhaber <vev@@michvhf.com>.
@
text
@d1 79
a79 3
<REFENTRY ID="SQL-MOVE">
<REFMETA>
<REFENTRYTITLE>
d81 24
a104 103
</REFENTRYTITLE>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
</REFMETA>
<REFNAMEDIV>
<REFNAME>
MOVE
</REFNAME>
<REFPURPOSE>
Moves cursor position
</REFPURPOSE>
  </refnamediv>                
<REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO>
<DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO>
<SYNOPSIS>
MOVE [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] [ <REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE> ] 
    { IN | FROM } <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL | NEXT | PRIOR ] } ] FROM ] <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
	</SYNOPSIS>
  </refsynopsisdiv>

  <REFSECT1 ID="R1-SQL-MOVE-1">
	<REFSECT1INFO>
	  <DATE>1998-09-24</DATE>
	</REFSECT1INFO>
	<TITLE>
	  Description
	</TITLE>
	<PARA>
	  <command>MOVE</command> allows a user to move cursor position a specified
	  number of rows.
	  <command>MOVE</command> works like the <command>FETCH</command> command,
	  but only positions the cursor and does
	  not return rows.
	</para>
	<para>
	  Refer to the <command>FETCH</command> command for details on syntax and usage.
	</para>

	<REFSECT2 ID="R2-SQL-MOVE-3">
	  <REFSECT2INFO>
		<DATE>1998-09-24</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		Notes
	  </TITLE>
	  <PARA>
		<command>MOVE</command> is a <productname>Postgres</productname>
		language extension.
	  </para>
	  <para>
		Refer to <command>FETCH</command> for a description
		of valid arguments.
		Refer to <command>DECLARE</command> to declare a cursor.
		Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
		<command>ROLLBACK WORK</command> statements
		for further information about transactions.
	  </para>
	</REFSECT2>
  </refsect1>

  <REFSECT1 ID="R1-SQL-MOVE-2">
	<TITLE>
	  Usage
	</TITLE>
	<PARA>
	  <ProgramListing>
		--set up and use a cursor:
		--
		BEGIN WORK;
		DECLARE liahona CURSOR  FOR SELECT * FROM films;
		
		--Skip first 5 rows:
		--
		MOVE FORWARD 5 IN liahona;
		<computeroutput>
		  MOVE
		</computeroutput>
		--Fetch 6th row in the cursor liahona:
		--
		FETCH 1 IN liahona;
		<computeroutput>
		  FETCH
		  code |title |did| date_prod|kind      |len
		  -----+------+---+----------+----------+------
		  P_303|48 Hrs|103|1982-10-22|Action    | 01:37
		  (1 row)
		</computeroutput>
		-- close the cursor liahona and commit work:
		--
		CLOSE liahona;
		COMMIT WORK;
	  </ProgramListing>
	</para>
  </REFSECT1>

  <REFSECT1 ID="R1-SQL-MOVE-3">
	<TITLE>
	  Compatibility
	</TITLE>
	<PARA>
	</PARA>
d106 33
a138 16
	<REFSECT2 ID="R2-SQL-MOVE-4">
	  <REFSECT2INFO>
		<DATE>1998-09-01</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		SQL92
	  </TITLE>
	  <PARA>
		There is no SQL92 <command>MOVE</command> statement. 
		Instead, <acronym>SQL92</acronym> allows
		one to <command>FETCH</command> rows from an absolute cursor position,
		implicitly moving the cursor to the correct place.
	  </para>
	</refsect2>
  </refsect1>
</REFENTRY>
@


1.3
log
@Cleanup markup and minor editing to prepare for first release.
@
text
@d15 1
a15 1
                
d24 2
a25 94
</SYNOPSIS>

<REFSECT1 ID="R1-SQL-MOVE-1">
<REFSECT1INFO>
<DATE>1998-09-24</DATE>
</REFSECT1INFO>
<TITLE>
Description
</TITLE>
<PARA>
   <command>MOVE</command> allows a user to move cursor position a specified
   number of rows.
 <command>MOVE</command> works like the <command>FETCH</command> command,
 but only positions the cursor and does
not return rows.

<para>
Refer to the <command>FETCH</command> command for details on syntax and usage.

<REFSECT2 ID="R2-SQL-MOVE-3">
<REFSECT2INFO>
<DATE>1998-09-24</DATE>
</REFSECT2INFO>
<TITLE>
Notes
</TITLE>
<PARA>
<command>MOVE</command> is a <productname>Postgres</productname>
 language extension.

<para>
   Refer to <command>FETCH</command> for a description
     of valid arguments.
   Refer to <command>DECLARE</command> to declare a cursor.
   Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
 <command>ROLLBACK WORK</command> statements
     for further information about transactions.

</REFSECT2>

<REFSECT1 ID="R1-SQL-MOVE-2">
<TITLE>
Usage
</TITLE>
<PARA>
<ProgramListing>
--set up and use a cursor:
--
BEGIN WORK;
    DECLARE liahona CURSOR  FOR SELECT * FROM films;
   
    --Skip first 5 rows:
    --
    MOVE FORWARD 5 IN liahona;
<computeroutput>
MOVE
</computeroutput>
    --Fetch 6th row in the cursor liahona:
    --
    FETCH 1 IN liahona;
<computeroutput>
FETCH
code |title |did| date_prod|kind      |len
-----+------+---+----------+----------+------
P_303|48 Hrs|103|1982-10-22|Action    | 01:37
(1 row)
</computeroutput>
    -- close the cursor liahona and commit work:
    --
    CLOSE liahona;
COMMIT WORK;
</ProgramListing>
 
</REFSECT1>

<REFSECT1 ID="R1-SQL-MOVE-3">
<TITLE>
Compatibility
</TITLE>
<PARA>
</PARA>

<REFSECT2 ID="R2-SQL-MOVE-4">
<REFSECT2INFO>
<DATE>1998-09-01</DATE>
</REFSECT2INFO>
<TITLE>
SQL92
</TITLE>
<PARA>
   There is no SQL92 <command>MOVE</command> statement. 
Instead, <acronym>SQL92</acronym> allows
one to <command>FETCH</command> rows from an absolute cursor position,
implicitly moving the cursor to the correct place.
d27 97
@


1.2
log
@Fix Postgres to support SQL92 syntax. Old syntax still works too.
@
text
@d18 1
a18 1
<DATE>1998-09-01</DATE>
d28 1
a28 1
<DATE>1998-04-15</DATE>
d34 4
a37 3
   MOVE allows a user to move cursor position a specified
   number of rows. MOVE works like the FETCH command, but only
positions the cursor and does
d41 1
a41 1
Refer to the FETCH command for details on syntax and usage.
d45 1
a45 1
<DATE>1998-04-15</DATE>
d51 2
a52 1
MOVE is a <productname>Postgres</productname> language extension.
d55 1
a55 1
   Refer to FETCH for a description
d57 3
a59 2
   Refer to DECLARE to declare a cursor.
   Refer to BEGIN WORK, COMMIT WORK, ROLLBACK WORK statements
d70 4
a73 9
   --set up and use a cursor:
   --
   BEGIN WORK;
     DECLARE liahona CURSOR 
         FOR SELECT * FROM films;
   
   --Skip first 5 rows:
   --
     MOVE FORWARD 5 IN liahona;
d75 20
a94 12
   --Fetch 6th row in the cursor liahona:
   --
     FETCH 1 IN liahona;

     code |title |did| date_prod|kind      |len
     -----+------+---+----------+----------+------
     P_303|48 Hrs|103|1982-10-22|Action    | 01:37

   -- close the cursor liahona and commit work:
   --
     CLOSE liahona;
   COMMIT WORK;
d114 5
a118 2
   There is no SQL92 MOVE statement. Instead, <acronym>SQL92</acronym> allows
one to FETCH rows from an absolute cursor position.
@


1.1
log
@Add more new pages.
@
text
@d21 3
a23 1
MOVE [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL ] } IN <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
a25 96
<REFSECT2 ID="R2-SQL-MOVE-1">
<REFSECT2INFO>
<DATE>1998-09-01</DATE>
</REFSECT2INFO>
<TITLE>
Inputs
</TITLE>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>

<variablelist>
<varlistentry>
<term>
FORWARD
</term>
<listitem>
<para>
Skip next row(s), it is assumed by default
                       if selector is omitted.

<varlistentry>
<term>
BACKWARD
</term>
<listitem>
<para>
Skip previous row(s).

</variablelist>

<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
         An unsigned integer that specify how many rows to skip.

<VARLISTENTRY>
<TERM>
ALL
</TERM>
<LISTITEM>
<PARA>
Skip all remaining rows.

<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
         An open cursor's name.

</VARIABLELIST>

</REFSECT2>

<REFSECT2 ID="R2-SQL-MOVE-2">
<REFSECT2INFO>
<DATE>1998-09-01</DATE>
</REFSECT2INFO>
<TITLE>
Outputs
</TITLE>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
MOVE
</TERM>
<LISTITEM>
<PARA>
         Message returned if successfully. 

<VARLISTENTRY>
<TERM>
NOTICE:  PerformPortalFetch: portal <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE> not found.
</TERM>
<LISTITEM>
<PARA>
         If cursor is not declared.

</VARIABLELIST>

</REFSECT2>
</REFSYNOPSISDIV>

d34 7
a40 3
   MOVE allows a user to move cursor position for specified
   number of rows. MOVE works like fetch command: it
   fetches rows, but put them nowhere.
d53 1
a53 1
   Refer to FETCH statements for further description
d55 1
a55 1
   Refer to DECLARE statements to declare a cursor.
d108 2
a109 1
   There is no SQL92 MOVE statement.
@
