Solo quería comentarles que finalmente pude resolver el problema de mostrar
imágenes, adaptando el código php ya que no pude actualizar la librería
php-pgsql
El código utilizado es el sugerido en un comentario del manual de php:
http://php.net/manual/en/function.pg-escape-bytea.php :

*Mike-RaWare 08-Jul-2010 02:03*
To prevent any problems with encoding you could use hexadecimal or base64
input to save and retrieve data to the database:

<?php
  // Connect to the database
  $dbconn = pg_connect( 'dbname=foo' );
  // Read in a binary file
  $data = file_get_contents( 'image1.jpg' );
  // Escape the binary data
  $escaped = bin2hex( $data );
  // Insert it into the database
  pg_query( "INSERT INTO gallery (name, data) VALUES ('Pine trees',
decode('{$escaped}' , 'hex'))" );

  // Get the bytea data
  $res = pg_query("SELECT encode(data, 'base64') AS data FROM gallery WHERE
name='Pine trees'");
  $raw = pg_fetch_result($res, 'data');
  // Convert to binary and send to the browser
  header('Content-type: image/jpeg');
  echo base64_decode($raw);
?>


De todas maneras muchas gracias
Guillermo

Responder a