Re: pg_upgrade: How to deal with toast

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: pg_upgrade: How to deal with toast
Дата
Msg-id 49253DD2.2080004@enterprisedb.com
обсуждение исходный текст
Ответ на Re: pg_upgrade: How to deal with toast  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Ответы Re: pg_upgrade: How to deal with toast  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список pgsql-hackers
Zdenek Kotala wrote:
> Heikki Linnakangas napsal(a):
>> 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.

It the new attribute is added to the end, the old tuples will be 
compatible as is. If there's no null bitmap (or it's shorter than 
expectd), attributes missing from a tuple are implicitly NULL. That's 
how we support ALTER TABLE ADD COLUMN without rewriting all the data.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Zdenek Kotala
Дата:
Сообщение: Re: pg_upgrade: How to deal with toast
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Transactions and temp tables