Re: Seek within Large Object, within PL/* function?

Поиск
Список
Период
Сортировка
От Adam Seering
Тема Re: Seek within Large Object, within PL/* function?
Дата
Msg-id 491F1737.4090202@gmail.com
обсуждение исходный текст
Ответ на Re: Seek within Large Object, within PL/* function?  (Klint Gore <kgore4@une.edu.au>)
Ответы Re: Seek within Large Object, within PL/* function?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: Seek within Large Object, within PL/* function?  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general

Klint Gore wrote:
>>     I'm playing around with storing custom preprocessed data
>> structures within Large Objects.  I'd like to be able to write a
>> custom function that will, within a query, let me select out
>> particular bytestrings from the middle of a Large Object (within C, I
>> think 'lo_lseek' and 'lo_read' would get me what I want).
>>
> According to http://www.postgresql.org/docs/8.3/static/lo-funcs.html ,
> the functions are server side too

Thanks for the link; still trying to figure out how to use these
functions, though.

The link that you sent suggests that these commands are really only
useful for writing out data to server-side files, which isn't so much
what I want.  What I really want is to lo_open a file, then lo_lseek to
a particular address and loread a constant number of bytes (to be
returned as the query result), then lo_close the file.

I'm currently stuck on the easy part:  lo_open always returns 0, which
gives me "ERROR:  invalid large-object descriptor: 0" when I try to use
it with loread.

Any further thoughts?

Thanks,
Adam

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Delete cascade trigger runs security definer
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Seek within Large Object, within PL/* function?