<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.pg-lo-import.php',
    1 => 'pg_lo_import',
    2 => 'Importa un large object da un file',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.pg-lo-export.php',
    1 => 'pg_lo_export',
  ),
  'next' => 
  array (
    0 => 'function.pg-lo-open.php',
    1 => 'pg_lo_open',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/pgsql/functions/pg-lo-import.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-lo-import" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_lo_import</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_lo_import</span> &mdash; <span class="dc-title">Importa un large object da un file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-lo-import-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_lo_import</strong></span>(<span class="methodparam"><span class="type"><a href="class.pgsql-connection.php" class="type PgSql\Connection">PgSql\Connection</a></span> <code class="parameter">$connection</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pathname</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$object_id</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_lo_import()</strong></span> crea un nuovo large object
   nel database utilizzando un file sul filesystem come origine
   dati.
  </p>
  <p class="para">
   Per utilizzare l&#039;interfaccia large object, è necessario
   racchiuderla in un blocco di transazione.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Questa funzione si chiamava <span class="function"><strong>pg_loimport()</strong></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-lo-import-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">connection</code></dt>
     <dd>
      <p class="para">An <span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span> instance.
When <code class="parameter">connection</code> is unspecified, the default connection is used.
The default connection is the last connection made by <span class="function"><a href="function.pg-connect.php" class="function">pg_connect()</a></span>
or <span class="function"><a href="function.pg-pconnect.php" class="function">pg_pconnect()</a></span>.
<div class="warning"><strong class="warning">Avviso</strong><p class="simpara">As of PHP 8.1.0, using the default connection is deprecated.</p></div></p>
     </dd>
    
    
     <dt><code class="parameter">pathname</code></dt>
     <dd>
      <p class="para">
       Il percorso completo e il nome del file sul filesystem
       del client da cui leggere i dati del large object.
      </p>
     </dd>
    
    
     <dt><code class="parameter">object_id</code></dt>
     <dd>
      <p class="para">
       Se viene fornito un <code class="parameter">object_id</code> la funzione
       proverà a creare un large object con questo id, altrimenti il server
       assegna un object ID libero. Il parametro
       si basa sulle funzionalità apparse
       per la prima volta in PostgreSQL 8.1.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-import-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   L&#039;<var class="varname">OID</var> del large object appena creato,  o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-lo-import-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  The <code class="parameter">connection</code> parameter expects an <span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span>
  instance now; previously, a <a href="language.types.resource.php" class="link">resource</a> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-lo-import-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Esempio di <span class="function"><strong>pg_lo_import()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?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_import</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #DD0000">'/tmp/lob.dat'</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">?&gt;</span></span></code></div>
    </div>

   </div> 
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.pg-lo-import-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-lo-export.php" class="function" rel="rdfs-seeAlso">pg_lo_export()</a> - Esporta un large object salvandolo su un file</span></li>
    <li><span class="function"><a href="function.pg-lo-open.php" class="function" rel="rdfs-seeAlso">pg_lo_open()</a> - Apre un large object</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>