Re: How does TOAST compare to other databases' mechanisms? - Mailing list pgsql-general

From Tom Lane
Subject Re: How does TOAST compare to other databases' mechanisms?
Date
Msg-id 2485.971540492@sss.pgh.pa.us
Whole thread Raw
In response to Re: How does TOAST compare to other databases' mechanisms?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-general
> This sounds fine, but begs the question: if there is TOASTed data in the
> table and the column is set to 'not TOASTed', will TOAST cope? And vice verca?

Yes; the detoasting mechanism doesn't pay any attention to attstorage,
only to what's actually in the stored tuple.  attstorage is only
examined while storing a tuple, and it's really only advisory anyway
(see tuptoaster.c).  The only "must" involved here is that you must not
set attstorage to anything but 'p' for a non-toastable data type; which
you determine by checking the type's pg_type entry (typstorage != 'p'
means toastable).

>> All told it might be a couple
>> hundred lines of new or changed code.  Pretty much all of this could
>> be done by cribbing from existing code (ie. programming-by-example)
>> which is a good thing because there's not much documentation.

> So it might be worh documenting, too...

Yes, if you wanted to keep notes and work them up into documentation
for future hackers, that'd be a nice side benefit.

            regards, tom lane

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: config
Next
From: Tom Lane
Date:
Subject: Re: Postgresql 7 does not always start on RH 6.2