Re: binary data storage

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: binary data storage
Дата
Msg-id m3u1qr1m5t.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Re: binary data storage  (Devrim GUNDUZ <devrim@oper.metu.edu.tr>)
Ответы Re: binary data storage  (Martín Marqués <martin@bugs.unl.edu.ar>)
Список pgsql-general
=?iso-8859-15?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar> writes:

> I still don't get it.
> If I use pg_lo* to put my binary data in the database, where will it be,
> always talking about the structure of the database.
> Example:
> A table with 5 fields, and one is of type oid, and I want to insert data (a
> new row to the table) in which I have a binary file to put in the oid field.
>
> And how about if I have more then one oid field?
>
> I see no specification on which field the binary object will be inserted.

Here's the way it works:

You create the LO with lo_create() or lo_import().  These give you an
OID that is your "handle" for getting at the LO data.  You then store
the OID in a column of type 'oid' in one or more of your tables.

To retrieve the LO data, fetch the OID from the table it lives in, and
use lo_open() and lo_read() to fetch the actual data.

Make sense?

-Doug
--
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: binary data storage
Следующее
От: Neil Conway
Дата:
Сообщение: Re: binary data storage