X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EFEB3D8803 for ; Fri, 2 Sep 2005 17:33:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63039-07 for ; Fri, 2 Sep 2005 20:33:12 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D7DB8D874E for ; Fri, 2 Sep 2005 17:33:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j82KXAFs017795; Fri, 2 Sep 2005 16:33:10 -0400 (EDT) To: leon@oss.minimetria.com Cc: pgsql-sql@postgresql.org Subject: Re: Recommendation on bytea or blob for binary data like images 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> Comments: In-reply-to leon@oss.minimetria.com message dated "Fri, 02 Sep 2005 12:15:46 -0700" Date: Fri, 02 Sep 2005 16:33:09 -0400 Message-ID: <17794.1125693189@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/18 X-Sequence-Number: 22565 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