Querying Large Objects

Started by David Kerrabout 17 years ago2 messagesgeneral
Jump to latest
#1David Kerr
dmk@mr-paradox.net

Hi all,

I'm having a heck of a time trying to track this down.
Is it possible to retrive a large object from psql/pgbench?

I don't want just the OID, i want the actual streamed data.

I'm doing a timing comparison between bytea and lo's. So it'd
be ideal if I can pull it with pgbench.

Thanks

Dave Kerr

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: David Kerr (#1)
Re: Querying Large Objects

David Kerr wrote:

I'm having a heck of a time trying to track this down.
Is it possible to retrive a large object from psql/pgbench?

I don't want just the OID, i want the actual streamed data.

I'm doing a timing comparison between bytea and lo's. So it'd
be ideal if I can pull it with pgbench.

You can do it with SQL:

SELECT loread(lo_open($1, 262144), 1073741819)

Where $1 is to be replaced with the OID of the large object.

Yours,
Laurenz Albe