Обсуждение: How to store jpeg files in Postgres Database

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

How to store jpeg files in Postgres Database

От
macdickson
Дата:
Can any one tell me how to store jpegh files in Postgres Database

bye

Macdickson

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Re: How to store jpeg files in Postgres Database

От
Peter Eisentraut
Дата:
Am Freitag, 15. Oktober 2004 08:37 schrieb macdickson:
> Can any one tell me how to store jpegh files in Postgres Database

Use the data type "bytea".

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: How to store jpeg files in Postgres Database

От
Juan Miguel
Дата:
Peter Eisentraut wrote:

>Am Freitag, 15. Oktober 2004 08:37 schrieb macdickson:
>
>
>>Can any one tell me how to store jpegh files in Postgres Database
>>
>>
>
>Use the data type "bytea".
>
>
>
First, Sorry about my english.

I use the "lo" type (see contrib folder). This is similar to oid type,
but helps you managing the deletion of a record. For example, when you
delete a record where a column contains a OID reference, postgres does
not delete de large object referenced. If the type of a column is lo,
you could create a trigger that perform the function lo_manage given by
the library of "lo", that automaticaly delete the large object. In this
case, the column only stores the object identifier (imagine an integer),
instead of the full image like a bytea column.

¿ Why I use "lo" or "oid" ? Because when you connect to a database via
ODBC, the "lo" or "oid" column's type is recognized like a "blob field",
then I can link this field with grids or other controls that show the
content (a JPG image for example).