Search Postgresql Archives

Re: Load Image File From PostgreSQL DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please don't top post.

Julius Tuskenis wrote:
>> Large Objects (http://www.postgresql.org/docs/current/static/largeobjects.html)
>> use OID columns, and they work fine for storing binary data like images.
>
> 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.

Yes, that's true.
You'll have to use the large object API to access the data.
All I wanted to point out is that while you cannot store binary data
*IN* an OID column, you can very well do so *USING* an OID column.

> 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?

Yes, it is easier, and probably in most cases better, to use bytea.
I think that large objects are preferrable ony if
a) you need to store more than 1GB or
b) you need the operations that only large objects provide, like
   reading out only part of the binary data.

I don't quite understand what you wrote about lo_read and libpq,
because libpq provides lo_open.

Yours,
Laurenz Albe

-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux