Re: bytea or large object

From: Frank Joerdens <frank(at)joerdens(dot)de>
To: Frank Joerdens <frank(at)joerdens(dot)de>
Cc: Jean-Christophe FABRE <jean-christophe(dot)fabre(at)ensam(dot)inra(dot)fr>, pgsql-sql(at)postgresql(dot)org, linuxkurs(at)fas-art(dot)com, adam(at)archi-me-des(dot)de
Subject: Re: bytea or large object
Date: 2002-04-04 10:36:41
Message-ID: 20020404123641.B30196@superfly.archi-me-des.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Martín Marqués 2002-04-04 11:08:40 Re: [SQL] bytea or large object
Previous Message Frank Joerdens 2002-04-04 09:40:51 Re: bytea or large object

Browse pgsql-sql by date

  From Date Subject
Next Message Martín Marqués 2002-04-04 11:08:40 Re: [SQL] bytea or large object
Previous Message Frank Joerdens 2002-04-04 09:40:51 Re: bytea or large object