X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B8A00D1DAA0 for ; Sun, 15 Feb 2004 18:44:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 59186-02 for ; Sun, 15 Feb 2004 14:44:53 -0400 (AST) Received: from screamer.tcp-ip.info (screamer.tcp-ip.info [68.167.18.162]) by svr1.postgresql.org (Postfix) with ESMTP id 934B3D1DA69 for ; Sun, 15 Feb 2004 14:44:51 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by screamer.tcp-ip.info (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id i1FIikMP008563; Sun, 15 Feb 2004 13:44:46 -0500 Date: Sun, 15 Feb 2004 13:44:46 -0500 (EST) From: Dana Hudes X-X-Sender: dhudes@screamer.tcp-ip.info To: beyaNet Consultancy Cc: pgsql-sql@postgresql.org Subject: Re: bytea or blobs? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/188 X-Sequence-Number: 16878 I'm in the same situation. I struggled with it for days considering various implementation issues for my application and what I hoped to achieve. I opted to use bytea but getting the data in and out is going to be interesting . have to use encode/decode. However I don't have to worry about making triggers and associated to invoke lo_import/export/unlink. There is no true BLOB in Postgresql. There is use of OID column and lo_import et al and there is bytea. My objective to assure integrity of the database lead me to want bytea. I am not by any means done with the situation and would welcome discussion. I'm using Perl for my application language. On Wed, 11 Feb 2004, beyaNet Consultancy wrote: > Hi, > what I am trying to do is to be able to store images in my database. > What I wanted to know is this: > > 1. Would it be better to have the image field type as a bytea or a > blob? I have heard it mentioned that bytea would be better as doing > data dumps would also insure that the image was saved as well! > > 2. Would it be better to make reference to mp3 files (i.e. storing the > address of the image /images/*.jpg) or is it feasible to store the mp3 > in the database as bytea or blobs as well? > > many thanks in adavance > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >