How to reclaim the space of dropped columns of a table?

Поиск
Список
Период
Сортировка
От Paul Guo
Тема How to reclaim the space of dropped columns of a table?
Дата
Msg-id CAEET0ZEBVajjf6wF6Q6e1VEucr0QG40o5-CPB7LW3H7t7AtgVA@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to reclaim the space of dropped columns of a table?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Hello hackers,

I have been having a question about this with no answer from various sourcesAs known after dropping a column using 'alter table', table is not rewritten and vacuum full does not remove them also (still see the dropped column in pg_attribute).

PG document says:


"To force immediate reclamation of space occupied by a dropped column, you can execute one of the forms of ALTER TABLE that performs a rewrite of the whole table. This results in reconstructing each row with the dropped column replaced by a null value."

This seems to a bit vague for users (how to rewrite but keep the table definition) and it seems to still keep the dropped columns (though with null). Isn't it better to leave the functionality to command like 'vacuum full' to completely remove the dropped columns (i.e. no dropped columns in pg_attributes and no null values for dropped columns for a table)?

Thanks.

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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: PG 12 draft release notes
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: How to reclaim the space of dropped columns of a table?