pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Recommendation on bytea or blob for binary data like images
3+ messages / 3 participants
[nested] [flat]

* Recommendation on bytea or blob for binary data like images
@ 2005-09-02 19:15 leon@oss.minimetria.com
  2005-09-02 20:33 ` Re: Recommendation on bytea or blob for binary data like images Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: leon@oss.minimetria.com @ 2005-09-02 19:15 UTC (permalink / raw)
  To: pgsql-sql

Hi, I'd like to know what the official recommendation is on which binary
datatype to use for common small-binary size use.

I'm working with the Open For Business (www.ofbiz.org) framework, which by
default maps binary data, such as shipping label images, into OID field
types. In general, the data is far less than a gigabyte in size. Is it
strongly recommended by the postgresql community to store things like this
in bytea format as of 8.0?

Thanks,

Leon Torres
leon@oss.minimetria.com
Open Source Strategies
http://opensourcestrategies.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Recommendation on bytea or blob for binary data like images
  2005-09-02 19:15 Recommendation on bytea or blob for binary data like images leon@oss.minimetria.com
@ 2005-09-02 20:33 ` Tom Lane <tgl@sss.pgh.pa.us>
  2005-09-06 20:21   ` Re: Recommendation on bytea or blob for binary data like images Leon Torres <leon@oss.minimetria.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2005-09-02 20:33 UTC (permalink / raw)
  To: leon@oss.minimetria.com; +Cc: pgsql-sql

leon@oss.minimetria.com writes:
> Hi, I'd like to know what the official recommendation is on which binary
> datatype to use for common small-binary size use.

If bytea will work for you, it's definitely the thing to use.  The only
real drawback to bytea is that there's currently no API to read and
write bytea values in a streaming fashion.  If your objects are small
enough that you can load and store them as units, bytea is fine.

BLOBs, on the other hand, have a number of drawbacks --- hard to dump,
impossible to secure, etc.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Recommendation on bytea or blob for binary data like images
  2005-09-02 19:15 Recommendation on bytea or blob for binary data like images leon@oss.minimetria.com
  2005-09-02 20:33 ` Re: Recommendation on bytea or blob for binary data like images Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-09-06 20:21   ` Leon Torres <leon@oss.minimetria.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Leon Torres @ 2005-09-06 20:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

Thanks for the quick response. We will be using bytea from now on. :-)

- Leon

Tom Lane wrote:

>leon@oss.minimetria.com writes:
>  
>
>>Hi, I'd like to know what the official recommendation is on which binary
>>datatype to use for common small-binary size use.
>>    
>>
>
>If bytea will work for you, it's definitely the thing to use.  The only
>real drawback to bytea is that there's currently no API to read and
>write bytea values in a streaming fashion.  If your objects are small
>enough that you can load and store them as units, bytea is fine.
>
>BLOBs, on the other hand, have a number of drawbacks --- hard to dump,
>impossible to secure, etc.
>
>			regards, tom lane
>
>  
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-09-06 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-02 19:15 Recommendation on bytea or blob for binary data like images leon@oss.minimetria.com
2005-09-02 20:33 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-09-06 20:21   ` Leon Torres <leon@oss.minimetria.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox