Getting image from a DB - Mailing list pgsql-admin

From Félix Sánchez Rodríguez
Subject Getting image from a DB
Date
Msg-id 006101c9cf3f$fa877380$3000a8c0@atenea
Whole thread Raw
Responses Re: Getting image from a DB  (Andy Shellam <andy-lists@networkmail.eu>)
List pgsql-admin
Hi:
 
Has anybody here had to capture an image from a PostgreSQL Data Base using PHP?? I used a simple query: select photo from people where id = 3, for instance. The problem is that when I write the image to disk it's not a valid image. I opened it using an HEX editor and saw that the question is that for each "strange" character, like ÿ, it writes, for instance, \377, it is, the "\" symbol plus the character's numeric code. I guessed that there were some function for this situation but I couldn't find it. If you can't help me, I'll have to parse the whole image contents, with the subsequent performance impact.
 
PD: The image field is of type bytea,as you recommend me.

pgsql-admin by date:

Previous
From: Lennin Caro
Date:
Subject: Re: How to run PostgreSQL?
Next
From: Andy Shellam
Date:
Subject: Re: Getting image from a DB