Re: bytea - Mailing list pgsql-general

From scott.marlowe
Subject Re: bytea
Date
Msg-id Pine.LNX.4.33.0405111401150.23073-100000@css120.ihs.com
Whole thread Raw
In response to Re: bytea  (Dennis Gearon <gearond@fireserve.net>)
Responses Re: bytea  (David Garamond <lists@zara.6.isreserved.com>)
List 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.



pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: security question
Next
From: CSN
Date:
Subject: template1, createdb, schemas, and owners