Re: pg_upgrade: How to deal with toast

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade: How to deal with toast
Date: 2008-11-20 10:21:07
Message-ID: 49253A13.4000501@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas napsal(a):
> Zdenek Kotala wrote:
>> The question is if we should do toast modification now to avoid
>> potential future problems or if we will solve it when any on-disk
>> format change requires it?
>
> Perhaps we should just add the new attid attribute to the toast table,
> but mark it as nullable? We wouldn't need to fill it in in the 8.3->8.4
> conversion but new tuples would include it.
>
> In the future release that we actually need it, we'll make it
> non-nullable, and write a pre-upgrade script to retoast tuples that
> don't have it yet.

Hmm, It seems to me as a good idea. It will complicated preupgrade script for
8.4->8.5 script but we will have one year to developed it :-).

What we need to do is during conversion to add nullbit array for each tuple in
toasttable. I think there is enough space on all platform to reuse gap between
tuple header and data.

> Hmm. That would change TOAST_MAX_CHUNK_SIZE, though.

Yes, it change it. :(

but I can convert easily residx to offset end (residx*TOAST_MAX_CHUNK_SIZE -+
something) during page conversion.

>> I prefer do it now, because there could be small risk that it will not
>> possible to do it in the future. When in-place upgrade will be
>> implemented nobody will want to perform backup/restore.
>
> I feel we should avoid doing anything extra, risking that we get nothing
> finished.

Agree.

Zdenek

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-11-20 10:37:06 Re: pg_upgrade: How to deal with toast
Previous Message Simon Riggs 2008-11-20 10:10:05 Re: [PATCHES] Infrastructure changes for recovery (v8)