pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: leon@oss.minimetria.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Recommendation on bytea or blob for binary data like images
Date: Fri, 02 Sep 2005 16:33:09 -0400
Message-ID: <17794.1125693189@sss.pgh.pa.us> (raw)
In-Reply-To: <42165.70.34.104.163.1125688546.squirrel@webmail.oss.minimetria.com>
References: <42165.70.34.104.163.1125688546.squirrel@webmail.oss.minimetria.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <17794.1125693189@sss.pgh.pa.us>
Permalink:  ../17794.1125693189@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17794.1125693189@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, leon@oss.minimetria.com
  Subject: Re: Recommendation on bytea or blob for binary data like images
  In-Reply-To: <17794.1125693189@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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