Skip site navigation (1) Skip section navigation (2)

Re: Applying TOAST to CURRENT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Applying TOAST to CURRENT
Date: 2000-05-30 15:07:05
Message-ID: 2155.959699225@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
JanWieck(at)t-online(dot)de (Jan Wieck) writes:
>>>> OTOH  I  don't  think  it's  a good thing to try creating
>>>> these things on  the  fly  the  first  time  needed.  The
>>>> required catalog changes and file creations introduce all
>>>> kinds of possible rollback/crash problems, that we  don't
>>>> want to have here - do we?

AFAIK we are pretty solid on rolling back table creation, it's just
rename/drop that have problems.  A worse problem is what if two
backends both decide they need to create the toast table at the same
time.  That might be fixable with appropriate locking but it seems
like there'd be potential for deadlocks.

> Bruce Momjian wrote:
>> Well, we could print the message suggesing ALTER TABLE when printing
>> tuple too large.  Frankly, I don't see a problem in creating the backup
>> table automatically.  If you are worried about performance, how about
>> putting it in a subdirectory.

I agree with Bruce --- the toast table should be created automatically,
at least if the table contains any potentially-toastable columns.  We
want this to be as transparent as possible.  I'd rather have auto create
on-the-fly when first needed, but if that seems too risky then let's
just make the table when its owning table is created.

If you want to control it with an ALTER TABLE function, let's add ALTER
TABLE DROP TOAST so that admins who don't like the excess space usage
can get rid of it.  (Of course that should only succeed after verifying
the toast table is empty...)

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-05-30 15:27:19
Subject: Re: Rename database?
Previous:From: Tom LaneDate: 2000-05-30 14:57:53
Subject: Re: Applying TOAST to CURRENT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group