1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>30.3.Closing a Connection</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="ecpg.html" title="Chapter30.ECPG - Embedded SQL in C">
<link rel="prev" href="ecpg-connect.html" title="30.2.Connecting to the Database Server">
<link rel="next" href="ecpg-commands.html" title="30.4.Running SQL Commands">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="ecpg-disconnect"></a>30.3.Closing a Connection</h2></div></div></div>
<p> To close a connection, use the following statement:
</p>
<pre class="programlisting">EXEC SQL DISCONNECT [<span class="optional"><em class="replaceable"><code>connection</code></em></span>];</pre>
<p>
The <em class="replaceable"><code>connection</code></em> can be specified
in the following ways:
</p>
<div class="itemizedlist"><ul type="disc">
<li> <code class="literal"><em class="replaceable"><code>connection-name</code></em></code>
</li>
<li> <code class="literal">DEFAULT</code>
</li>
<li> <code class="literal">CURRENT</code>
</li>
<li> <code class="literal">ALL</code>
</li>
</ul></div>
<p>
If no connection name is specified, the current connection is
closed.
</p>
<p> It is good style that an application always explicitly disconnect
from every connection it opened.
</p>
</div></body>
</html>
|