<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.pg-lo-import.php',
    1 => 'pg_lo_import',
    2 => 'Importiert ein Large Object aus einer Datei',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL-Funktionen',
  ),
  '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' => 'de',
    '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">Importiert ein Large Object aus einer Datei</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-lo-import-description">
  <h3 class="title">Beschreibung</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">int|string|false</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_lo_import()</strong></span> erzeugt aus einer Datei im Dateisystem
   als Datenquelle ein neues Large Object in der Datenbank.
  </p>
  <p class="para">
   Um die Large Object- (lo) Schnittstelle benutzen zu können, müssen die
   Kommandos innerhalb einer Transaktion ausgeführt werden.
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Diese Funktion ersetzt die Funktion <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">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">connection</code></dt>
     <dd>
      <p class="para">Eine <span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span>-Instanz.
Falls <code class="parameter">connection</code> nicht angegeben wurde, wird die Standardverbindung benutzt.
Das ist die zuletzt mit <span class="function"><a href="function.pg-connect.php" class="function">pg_connect()</a></span> oder <span class="function"><a href="function.pg-pconnect.php" class="function">pg_pconnect()</a></span> aufgebaute Verbindung.
<div class="warning"><strong class="warning">Warnung</strong><p class="simpara">Seit PHP 8.1.0 ist die Verwendung der Standardverbindung veraltet.</p></div></p>
     </dd>
    
    
     <dt><code class="parameter">pathname</code></dt>
     <dd>
      <p class="para">
       Der vollständige Pfad- und Dateiname der Datei im lokalen Dateisystem
       des Clients, aus der die Daten des Large Objects gelesen werden.
      </p>
     </dd>
    
    
     <dt><code class="parameter">object_id</code></dt>
     <dd>
      <p class="para">
       Wenn es einen Parameter <code class="parameter">object_id</code> gibt, wird
       diese Funktion versuchen, ein Large Object mit dieser ID zu erzeugen.
       Anderenfalls wird dem Large Object vom Server eine freie ID zugewiesen.
       Dieser Parameter basiert auf Funktionalitäten, die seit PostgreSQL 8.1
       implementiert sind.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-import-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Die <var class="varname">OID</var> des neu erzeugten Large Objects. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-function.pg-lo-import-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Der Parameter <code class="parameter">connection</code> erwartet nun eine <span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span>-Instanz;
  vorher wurde eine <a href="language.types.resource.php" class="link">Ressource</a> erwartet.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-lo-import-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>pg_lo_import()</strong></span>-Beispiel</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">Siehe auch</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> - Exportiert ein Large Object in eine Datei</span></li>
    <li><span class="function"><a href="function.pg-lo-open.php" class="function" rel="rdfs-seeAlso">pg_lo_open()</a> - &Ouml;ffnet ein Large Object</span></li>
   </ul>
  </p>
 </div>


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