<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Close a large object</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.pg-last-oid.html">pg_last_oid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-create.html">pg_lo_create</a></div> <div class="up"><a href="ref.pgsql.html">PostgreSQL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.pg-lo-close" class="refentry"> <div class="refnamediv"> <h1 class="refname">pg_lo_close</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">pg_lo_close</span> — <span class="dc-title">Close a large object</span></p> </div> <div class="refsect1 description" id="refsect1-function.pg-lo-close-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>pg_lo_close</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$large_object</code></span> )</div> <p class="para rdfs-comment"> <span class="function"><strong>pg_lo_close()</strong></span> closes a large object. <em><code class="parameter">large_object</code></em> is a resource for the large object from <span class="function"><a href="function.pg-lo-open.html" class="function">pg_lo_open()</a></span>. </p> <p class="para"> To use the large object interface, it is necessary to enclose it within a transaction block. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This function used to be called <span class="function"><strong>pg_loclose()</strong></span>. </p> </p></blockquote> </div> <div class="refsect1 parameters" id="refsect1-function.pg-lo-close-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">result</code></em></span> <dd> <p class="para"> PostgreSQL large object (LOB) resource, returned by <span class="function"><a href="function.pg-lo-open.html" class="function">pg_lo_open()</a></span>. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-close-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-function.pg-lo-close-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2088"> <p><strong>Example #1 <span class="function"><strong>pg_lo_close()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /> $database </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=jacarta"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #DD0000">"begin"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$oid </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_lo_create</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">);<br /> echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$oid</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$handle </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_lo_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #0000BB">$oid</span><span style="color: #007700">, </span><span style="color: #DD0000">"w"</span><span style="color: #007700">);<br /> echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$handle</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">pg_lo_write</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">, </span><span style="color: #DD0000">"large object data"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">pg_lo_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #DD0000">"commit"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.pg-lo-close-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.pg-lo-open.html" class="function" rel="rdfs-seeAlso">pg_lo_open()</a> - Open a large object</span></li> <li class="member"> <span class="function"><a href="function.pg-lo-create.html" class="function" rel="rdfs-seeAlso">pg_lo_create()</a> - Create a large object</span></li> <li class="member"> <span class="function"><a href="function.pg-lo-import.html" class="function" rel="rdfs-seeAlso">pg_lo_import()</a> - Import a large object from file</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.pg-last-oid.html">pg_last_oid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-create.html">pg_lo_create</a></div> <div class="up"><a href="ref.pgsql.html">PostgreSQL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>