Re: Load Image File From PostgreSQL DB - Mailing list pgsql-general

From Julius Tuskenis
Subject Re: Load Image File From PostgreSQL DB
Date
Msg-id 495A471D.7090807@gmail.com
Whole thread Raw
In response to Re: Load Image File From PostgreSQL DB  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Responses Re: Load Image File From PostgreSQL DB
List pgsql-general
Hello, Albe

In the article you provided it is said that "The return value is the OID
that was assigned to the new large object..." (function Oid
lo_creat(PGconn *conn, int mode);). That means that not the large object
is stored in OID field - its just the reference to it.
Any way I find it much easier to get a relatively small blob in a result
set and not directly using lo_read function, because in delphi zeos
components does work with  libpq, so theres no need to bypass them?

Julius Tuskenis



Albe Laurenz rašė:
> dbalinglung wrote:
>
>>> I seriously doubt you could store an image in oid typed column, because
>>> "The oid type is currently implemented as an unsigned four-byte
>>> integer." (from postgresql 8.2 manual). I too use Zeos with no problems
>>> using bytea type.
>>>
>> Ok, I'll try your sugestion, many thanks bro.
>>
>
> Large Objects (http://www.postgresql.org/docs/current/static/largeobjects.html)
> use OID columns, and they work fine for storing binary data like images.
>
> But bytea will work just as fine.
>
> Yours,
> Laurenz Albe
>
>

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Load Image File From PostgreSQL DB
Next
From: Reg Me Please
Date:
Subject: Re: [PGSQL 8.3.5] Use of a partial indexes