pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Julien Cigar <jcigar@ulb.ac.be>
Cc: pgsql-sql@postgresql.org
Subject: Re: column type for pdf file
Date: Thu, 19 May 2011 10:15:04 +0800
Message-ID: <4DD47D28.3070207@postnewspapers.com.au> (raw)
In-Reply-To: <4DD43867.2040709@ulb.ac.be>
References: <4DD42A1C.30202@encs.concordia.ca>
	<4DD4301F.4010403@ulb.ac.be>
	<20110518210041.GF2498@hermes.hilbert.loc>
	<4DD43867.2040709@ulb.ac.be>

On 05/19/2011 05:21 AM, Julien Cigar wrote:
> On 05/18/2011 23:00, Karsten Hilbert wrote:
>> On Wed, May 18, 2011 at 10:46:23PM +0200, Julien Cigar wrote:
>>
>>> Unless you've good reasons to do so it's best to store the file on
>>> the file system
>> Why ?
>>
>> If you suggest reasons are needed for storing the PDF in the
>> database I'd like to know the reasons for *not* doing so.
>>
>
> It increases the load, consume connections, but the biggest drawback is
> probably the memory consumption ..
>
> IMHO storing binary data in a database is almost always a bad idea .. it
> could be OK to store things like avatars, small icons, etc, but
> certainly not to store files of several MB ... file systems are done for
> that !

_however_, you lose transactional properties when doing this. You can 
land up with a file that's been added/updated where the associated 
transaction in the DB failed or rolled back. Very careful application 
programming and the use of 2 phase commit can provide reliable 
behaviour, but it's not trivial.

This is one area where I envy Microsoft. As they control the file system 
and the database, they've been able to come up with a really cool system 
where the file system integrates into database transactions, so you kind 
of get the best of both worlds. Very cool. If reiser4 hadn't gone the 
way of the dodo such a thing might've become possible on Linux, but I'm 
not aware of any other Linux file systems that safely support transactions.

--
Craig Ringer



view thread (14+ messages)  latest in thread

Message-ID: <4DD47D28.3070207@postnewspapers.com.au>
Permalink:  ../4DD47D28.3070207@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4DD47D28.3070207@postnewspapers.com.au

 · 

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: craig@postnewspapers.com.au, jcigar@ulb.ac.be
  Subject: Re: column type for pdf file
  In-Reply-To: <4DD47D28.3070207@postnewspapers.com.au>

* 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