]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/close.sgml
More minor updates and copy-editing.
[postgresql] / doc / src / sgml / ref / close.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/close.sgml,v 1.22 2005/01/04 00:39:53 tgl Exp $
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-CLOSE">
7  <refmeta>
8   <refentrytitle id="SQL-CLOSE-TITLE">CLOSE</refentrytitle>
9   <refmiscinfo>SQL - Language Statements</refmiscinfo>
10  </refmeta>
11
12  <refnamediv>
13   <refname>CLOSE</refname>
14   <refpurpose>close a cursor</refpurpose>
15  </refnamediv>
16
17  <indexterm zone="sql-close">
18   <primary>CLOSE</primary>
19  </indexterm>
20
21  <indexterm zone="sql-close">
22   <primary>cursor</primary>
23   <secondary>CLOSE</secondary>
24  </indexterm>
25
26  <refsynopsisdiv>
27 <synopsis>
28 CLOSE <replaceable class="PARAMETER">name</replaceable>
29 </synopsis>
30  </refsynopsisdiv>
31
32  <refsect1>
33   <title>Description</title>
34
35   <para>
36    <command>CLOSE</command> frees the resources associated with an open cursor.
37    After the cursor is closed, no subsequent operations
38    are allowed on it. A cursor should be closed when it is
39    no longer needed.
40   </para>
41
42   <para>
43    Every non-holdable open cursor is implicitly closed when a
44    transaction is terminated by <command>COMMIT</command> or
45    <command>ROLLBACK</command>.  A holdable cursor is implicitly
46    closed if the transaction that created it aborts via
47    <command>ROLLBACK</command>.  If the creating transaction successfully
48    commits, the holdable
49    cursor remains open until an explicit <command>CLOSE</command> is
50    executed, or the client disconnects.
51   </para>
52  </refsect1>
53   
54  <refsect1>
55   <title>Parameters</title>
56
57   <variablelist>
58    <varlistentry>
59     <term><replaceable class="PARAMETER">name</replaceable></term>
60     <listitem>
61      <para>
62       The name of an open cursor to close.
63      </para>
64     </listitem>
65    </varlistentry>
66   </variablelist>
67  </refsect1>
68
69  <refsect1>
70   <title>Notes</title>
71
72   <para>
73    <productname>PostgreSQL</productname> does not have an explicit
74    <command>OPEN</command> cursor statement; a cursor is considered
75    open when it is declared.  Use the
76    <xref linkend="sql-declare" endterm="sql-declare-title">
77    statement to declare a cursor.
78   </para>
79  </refsect1>
80
81  <refsect1>
82   <title>Examples</title>
83
84   <para>
85    Close the cursor <literal>liahona</literal>:
86 <programlisting>
87 CLOSE liahona;
88 </programlisting>
89   </para>
90  </refsect1>
91  
92  <refsect1>
93   <title>Compatibility</title>
94   
95   <para>
96    <command>CLOSE</command> is fully conforming with the SQL standard.
97   </para>
98  </refsect1>
99
100  <refsect1>
101   <title>See Also</title>
102
103   <simplelist type="inline">
104    <member><xref linkend="sql-declare" endterm="sql-declare-title"></member>
105    <member><xref linkend="sql-fetch" endterm="sql-fetch-title"></member>
106    <member><xref linkend="sql-move" endterm="sql-move-title"></member>
107   </simplelist>
108  </refsect1>
109 </refentry>
110
111 <!-- Keep this comment at the end of the file
112 Local variables:
113 mode: sgml
114 sgml-omittag:t
115 sgml-shorttag:t
116 sgml-minimize-attributes:nil
117 sgml-always-quote-attributes:t
118 sgml-indent-step:1
119 sgml-indent-data:t
120 sgml-parent-document:nil
121 sgml-default-dtd-file:"../reference.ced"
122 sgml-exposed-tags:nil
123 sgml-local-catalogs:"/usr/lib/sgml/catalog"
124 sgml-local-ecat-files:nil
125 End:
126 -->