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 45 46 47 48 49 50 51
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SPI_finish</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="spi.html#spi-interface" title="40.1.Interface Functions">
<link rel="prev" href="spi-spi-connect.html" title="SPI_connect">
<link rel="next" href="spi-spi-push.html" title="SPI_push">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="spi-spi-finish"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>SPI_finish — disconnect a procedure from the SPI manager</p>
</div>
<a name="id734121"></a><div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">int SPI_finish(void)</pre>
</div>
<div class="refsect1" lang="en">
<a name="id734134"></a><h2>Description</h2>
<p> <code class="function">SPI_finish</code> closes an existing connection to
the SPI manager. You must call this function after completing the
SPI operations needed during your procedure's current invocation.
You do not need to worry about making this happen, however, if you
abort the transaction via <code class="literal">elog(ERROR)</code>. In that
case SPI will clean itself up automatically.
</p>
<p> If <code class="function">SPI_finish</code> is called without having a valid
connection, it will return <code class="symbol">SPI_ERROR_UNCONNECTED</code>.
There is no fundamental problem with this; it means that the SPI
manager has nothing to do.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id734176"></a><h2>Return Value</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="symbol">SPI_OK_FINISH</code></span></dt>
<dd><p> if properly disconnected
</p></dd>
<dt><span class="term"><code class="symbol">SPI_ERROR_UNCONNECTED</code></span></dt>
<dd><p> if called from an unconnected procedure
</p></dd>
</dl></div>
</div>
</div></body>
</html>
|