partitioned indexes and tablespaces

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема partitioned indexes and tablespaces
Дата
Msg-id 20181102003138.uxpaca6qfxzskepi@alvherre.pgsql
обсуждение исходный текст
Ответы Re: partitioned indexes and tablespaces  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hello

A customer reported to us that partitioned indexes are not working
consistently with tablespaces:

1. When a CREATE INDEX specifies a tablespace, existing partitions get
the index in the correct tablespace; however, the parent index itself
does not record the tablespace.  So when new partitions are created
later, they get the index in the default tablespace instead of the
specified tablespace.  Fix by saving the tablespace in the pg_class row
for the parent index.

2. ALTER TABLE SET TABLESPACE, applied to the partitioned index, would
raise an error indicating that it's not the correct relation kind.  In
order for this to actually work, we need bespoke code for ATExecCmd();
the code for all other relation kinds wants to move storage (and runs in
Phase 3, later), but these indexes do not have that.  Therefore, write a
cut-down version which is invoked directly in ATExecCmd instead.

3. ALTER INDEX ALL IN TABLESPACE, identical problem, is also fixed by
the above change.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Commitfest 2018-11
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: More issues with pg_verify_checksums and checksum verificationin base backups