pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Joerdens <frank@joerdens.de>
To: Frank Joerdens <frank@joerdens.de>
Cc: Jean-Christophe FABRE <jean-christophe.fabre@ensam.inra.fr>
Cc: pgsql-sql@postgresql.org
Cc: linuxkurs@fas-art.com
Cc: adam@archi-me-des.de
Subject: Re: bytea or large object
Date: Thu, 4 Apr 2002 12:36:41 +0200
Message-ID: <20020404123641.B30196@superfly.archi-me-des.de> (raw)
In-Reply-To: <20020404114051.A28343@superfly.archi-me-des.de>
References: <5.0.0.25.0.20020403164135.00ad0380@ensam.inra.fr>
	<20020404114051.A28343@superfly.archi-me-des.de>

On Thu, Apr 04, 2002 at 11:40:51AM +0200, Frank Joerdens wrote:
> On Wed, Apr 03, 2002 at 04:47:29PM +0200, Jean-Christophe FABRE wrote:
> > 
> > Hi,
> > 
> > I would like to store .pdf files in a database, which is accessed through a 
> > PHP interface.
> > which is the best way to store binary data?
> > - bytea? (with the tricky handling of escape chars)
> > - large objects?
> 
> I asked the same question a week ago on pgsql-general. Here's my 2
> cents: The Postgres large object interface is older and therefore more
> tried and tested. It used to have a reputation for slowness, but the
> code was overhauled in 7.1 to address this issue. The LO interface is a
> little convoluted and takes some getting used to, but works well. For
> Bytea you can use "normal" SQL syntax. Escaping the data is not
> really difficult.

I forgot: A distinct advantage of bytea over large objects is that you
can still use pg_dumpall to back up your entire server in a single step.
It doesn't work with large objects because pg_dumpall can't create
binary output in an e.g. tar file. This means that if you use large
objects, you have to back up your databases one by one, using a binary
output format with pg_dump.

Regards, Frank



view thread (7+ messages)  latest in thread

Message-ID: <20020404123641.B30196@superfly.archi-me-des.de>
Permalink:  ../20020404123641.B30196@superfly.archi-me-des.de/
Also on:    postgresql.org/message-id/20020404123641.B30196@superfly.archi-me-des.de

 · 

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: frank@joerdens.de, jean-christophe.fabre@ensam.inra.fr, linuxkurs@fas-art.com, adam@archi-me-des.de
  Subject: Re: bytea or large object
  In-Reply-To: <20020404123641.B30196@superfly.archi-me-des.de>

* 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