After a lot of head-scratching and unclear examples, mostly manual copies that are not very clear, I was able to load the client image to the database on the server without having the superuser problem in postgresql.
First, send the image to a temporary folder on the server, then pick up the image in the local folder and load it into the database.
Complete Code:
postgresql
create table testeimg as (id serial unique, imagem oid)
form
<form method="post" enctype="multipart/form-data">
<input type="file" name="imagem">
<button formaction="upload.php">UPLOAD</button>
</form>
upload.php
/* postgresql conexão */
$dbconn = pg_connect("host=localhost port=5432 dbname=teste user=usuario password=pass") or die('Não foi possível conectar: ' . pg_last_error());
/* recebe a imagem do formulário, define a pasta de destino, renomeia o arquivo para nome único e envia para a pasta indicada */
define('UPLOAD_DIR', '_tmp/');
$img = $_FILES["imagem"]["name"];
$img = str_replace('data:image/jpeg;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.jpg';
$success = file_put_contents($file, $data);
/* pega a imagem na pasta tmp e grava a imagem no banco */
pg_query($dbconn, "begin");
$oid = pg_lo_import($dbconn, '_tmp/'.$data . '.jpg');
$sql1 = "insert into testeimg (img) values('$oid')";
$res1 = pg_query($dbconn,$sql1) or die(pg_last_error($dbconn));
pg_query($dbconn, "commit");
/* elimina a imagem temporária */
unlink(UPLOAD_DIR . $idcliente . '.jpg');