Обсуждение: Querying Large Objects

Поиск
Список
Период
Сортировка

Querying Large Objects

От
David Kerr
Дата:
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

Re: Querying Large Objects

От
"Albe Laurenz"
Дата:
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