Re: bytea

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Dennis Gearon <gearond(at)fireserve(dot)net>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: bytea
Date: 2004-05-11 20:04:01
Message-ID: Pine.LNX.4.33.0405111401150.23073-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 11 May 2004, Dennis Gearon wrote:

> Thanks for all the answers everybody, but I need to know also an answer
> to the other question:
>
> Does the bytea make its own files automatically for large objects?

Bytea doesn't use large objects, which are kind of an artifact left over
from the days of the 8k row limit. They use what are called "toast"
tables. Toast tables allow for text/varchar/bytea types to overflow from
the base table as needed to occupy up to ~2 gigabytes of drive space per
field max. Note that I'm pretty sure no one's really tried to put 2 gig
in one field, as that would probably take quite some time, and I'm not
sure how well most clients are gonna handle getting back a row with a 2
gig field in it. :-)

And yes, toasting is fully automatic. Just insert a large
text/varchar/bytea field and the database does the rest. which is why
they are generally recommended over using large objects, which require
specialized handling.

> Also, how about backups with tables having bytea columns.?

Just like any other field. pg_dump will escape them as needed to make a
usable backup.

In response to

  • Re: bytea at 2004-05-11 18:50:06 from Dennis Gearon

Responses

  • Re: bytea at 2004-05-12 15:28:03 from David Garamond

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2004-05-11 20:23:18 Re: Adding MERGE to the TODO list (resend with subject)
Previous Message scott.marlowe 2004-05-11 20:00:11 Re: security question