Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET,RESET}

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET,RESET}
Дата
Msg-id YYCzlIBpoO6UtGCC@paquier.xyz
обсуждение исходный текст
Ответ на Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET,RESET}  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Sat, Oct 30, 2021 at 09:45:50AM +0900, Michael Paquier wrote:
> Another thing that could be done is to mark the index as invalid once
> its set of opclass parameters is updated.  That would be simpler,
> while allowing users to fire a concurrent or non-concurrent rebuild at
> will after an ALTER INDEX.

For the note here, I have looked at this possibility.  And things
become very tricky when it comes to indexes marked as either
indisclustered or indisreplident.  REINDEX CONCURRENTLY has the
particularity to switch both parameters to false when swapping to the
new index because we don't need the new index anymore.  Invalid
indexes can create with CREATE INDEX CONCURRENTLY (constraint failure
at creation for example), but they won't have any of those flags set.
So we assume now that indisinvalid is linked to both of them.

This makes the problem mentioned upthread trickier than it looks, as
we'd need to decide what to do after an ALTER INDEX that just switches
an index to be invalid if any of these are set for the existing
index.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: removing global variable ThisTimeLineID
Следующее
От: Greg Nancarrow
Дата:
Сообщение: Re: Skipping logical replication transactions on subscriber side