Re: Putting files into fields in a table

From: "Campbell, Lance" <lance(at)uiuc(dot)edu>
To: "Erik Jones" <erik(at)myemma(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Putting files into fields in a table
Date: 2007-12-13 20:54:10
Message-ID: B10E6810AC2A2F4EA7550D072CDE8760197E40@SAB-FENWICK.sab.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Erik,
The advantage with storing things in the database verses the file system
is the number of lines of code. I manage 18 software applications. I
have developed an application that reads in an XML file and will
generate database java code for inserting, updating, selecting and
deleting data. So for me the database is a no brainer. But when I need
to store files that are uploaded by users I have to hand code the
process. It is not hard. It is just time consuming. I want to keep
the amount I can do per hour at a very high level. The less code the
better.

Using a database correctly really saves on the number of lines of code.

Thanks,

Lance Campbell
Project Manager/Software Architect
Web Services at Public Affairs
University of Illinois
217.333.0382
http://webservices.uiuc.edu

-----Original Message-----
From: Erik Jones [mailto:erik(at)myemma(dot)com]
Sent: Thursday, December 13, 2007 2:22 PM
To: Campbell, Lance
Cc: pgsql-performance(at)postgresql(dot)org list
Subject: Re: [PERFORM] Putting files into fields in a table

On Dec 13, 2007, at 2:09 PM, Campbell, Lance wrote:

> I did not see much info in the 8.2 documentation on BLOB. I did ready
> about "bytea" or binary data type. It seems like it would work for
> storing files. I guess I could stick with the OS for file storage but
> it is a pain. It would be easier to use the DB.

In postgres they're simply called Large Objects (or LOBs) and there
is a whole chapter devoted to them in Part IV of the manual. Note
that you only need to use this facility if you're going to be storing
data over 1G in size (at which point your limit becomes 2G). What
kind of data are in these files? What gain do you foresee in storing
the files directly in the db (as opposed, say, to storing the paths
to the files in the filesystem)?

Erik Jones

Software Developer | Emma(r)
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2007-12-13 21:19:34 Re: Heavy write activity on first vacuum of fresh TOAST data
Previous Message Erik Jones 2007-12-13 20:22:04 Re: Putting files into fields in a table