I am using pgSQL 8.1.4. I have a table that stores pictures, using an oid
column.
Now using the SQL functions provided I have successfully saved an image to
the table, and managed to export it from the table again.
I am battling to open the image for reading into a stream. The mentioned
functions support opening for exporting a file in SQL are
SELECT lo_export(image.raster, '/tmp/motd') FROM image
WHERE name = 'beautiful image';
But how do I open a stream for reading?
inv_fd = lo_open(conn, inv_oid, INV_READ|INV_WRITE);
I have tried to convert this into a SQL statement but INV_READ is not seen
as an accepted parameter.