Display large object from database

From: "Greg" <greg(at)officium(dot)co(dot)za>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Display large object from database
Date: 2006-06-05 12:28:49
Message-ID: 000101c6889b$98dee250$ca9ca6f0$@co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-06-05 14:55:26 Re: Display large object from database
Previous Message Tom Lane 2006-06-04 02:02:04 Re: Creating users with name and email