title: php pg_lo_import is returning empty
body: <p>If anyone can help me, it will be of great help to me!</p>
  <p>8 months ago I started studying PHP and at that moment I developed a code together with a professor to save an image and save the OID in the database.</p>
  <p>But I changed computers, I'm currently using PHP 8. I'm trying to use the same code, but &quot;pg_lo_import&quot; it's returning empty.</p>
  <pre><code>pg_query($conexao, &quot;BEGIN;&quot;);
  
  $aFile = $_FILES['imagemPerfil'];
  $file = $aFile['name'];
  
  $candidato_photo = &quot;img/avatar.png&quot;;
  $candidato_photo_crop = &quot;img/avatar.png&quot;;
  $candidato_photo_coordenadas = NULL;
  
  if (!empty($file)) {
      $infoImg = $_POST[&quot;infoImg&quot;];
      $oParam = json_decode($infoImg);
      $candidato_photo_coordenadas = json_encode($oParam);
  
      $dir = 'img/foto_perfil';
      $ext = pathinfo($file, PATHINFO_EXTENSION);
      $newName = md5($file . date(&quot;YmdHis&quot;));
      $candidato_photo = &quot;{$dir}/{$newName}.{$ext}&quot;;    
  
      if (move_uploaded_file($aFile['tmp_name'], &quot;../&quot; . $candidato_photo)) {        
          $oid_candidato_photo = &quot;'&quot; . pg_lo_import($conexao, &quot;../&quot; . $candidato_photo) . &quot;'&quot;;
          // pg_lo_import IS RETURNING EMPTY BUT $candidato_photo ISN'T EMPTY
  
          $dst_x = 0;   // X-coordinate of destination point
          $dst_y = 0;   // Y-coordinate of destination point
          $src_x = $oParam-&gt;x; // Crop Start X position in original image
          $src_y = $oParam-&gt;y; // Crop Srart Y position in original image
          $dst_w = $oParam-&gt;width; // Thumb width
          $dst_h = $oParam-&gt;height; // Thumb height
          $src_w = $oParam-&gt;width; // Crop end X position in original image
          $src_h = $oParam-&gt;height; // Crop end Y position in original image
  
          $dst_image = imagecreatetruecolor($dst_w, $dst_h);
  
          $candidato_photo_crop = &quot;{$dir}/{$newName}_crop.{$ext}&quot;;
  
          if ($ext == &quot;jpeg&quot; or $ext == &quot;jpg&quot;) {
              $src_image = imagecreatefromjpeg(&quot;../&quot; . $candidato_photo);
              imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
              imagejpeg($dst_image, &quot;../&quot; . $candidato_photo_crop);
          } else {
              $src_image = imagecreatefrompng(&quot;../&quot; . $candidato_photo);
              imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
              imagepng($dst_image, &quot;../&quot; . $candidato_photo_crop);
          }
  
          $oid_candidato_photo_crop = &quot;'&quot; . pg_lo_import($conexao, &quot;../&quot; . $candidato_photo_crop) . &quot;'&quot;;
      } else {
          die(&quot;Possível ataque de upload de arquivo!&quot;);
      }
  }
  </code></pre>