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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Seek within Large Object, within PL/* function?
Дата
Msg-id 162867790811151136x740e05b4qd5ef055ff99ea24f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Seek within Large Object, within PL/* function?  (Adam Seering <aseering@gmail.com>)
Список pgsql-general
Hello

I am not sure, but you are first who try to work with LO inside PL.
Current LO interface works well for client side, and probably doesn't
work on server side via SPI interface - so I am sure, so some is
possible, but you need do some C hacking.

regards
Pavel Stehule

2008/11/15 Adam Seering <aseering@gmail.com>:
>
>
> 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
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

Предыдущее
От: Adam Seering
Дата:
Сообщение: Re: Seek within Large Object, within PL/* function?
Следующее
От: "Phoenix Kiula"
Дата:
Сообщение: Vacuum Full is *hideously* slow!