X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3F56C9FB20E for ; Thu, 27 Jul 2006 15:03:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 33657-09 for ; Thu, 27 Jul 2006 15:03:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id A42CF9FB20B for ; Thu, 27 Jul 2006 15:03:36 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1G6AMs-00080e-3x for pgsql-sql@postgresql.org; Thu, 27 Jul 2006 14:13:54 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id C22784172; Thu, 27 Jul 2006 14:03:29 -0400 (EDT) Date: Thu, 27 Jul 2006 14:03:29 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Storage of Binary Data Message-ID: <20060727180329.GF27075@phlogiston.dyndns.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200607/335 X-Sequence-Number: 25909 > For my web projects, we have been storing binary data (like images, PDF's, > etc) on the hard drive of the web server instead of the database. Within > the database, we keep information, like whether an image is present, in a > separate column. In most cases, this is probably the best approach. It has the problem that COMMITs of this data aren't atomic (the file write could succeed and the database write fail, for example). But that can usually be worked around, and at least you're not bulking your database with binaries. A -- Andrew Sullivan | ajs@crankycanuck.ca This work was visionary and imaginative, and goes to show that visionary and imaginative work need not end up well. --Dennis Ritchie