Re: propagating replica identity to partitions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: propagating replica identity to partitions
Дата
Msg-id 201902042353.r3aqj2cx4hvz@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: propagating replica identity to partitions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: propagating replica identity to partitions  (Dmitry Dolgov <9erthalion6@gmail.com>)
Re: propagating replica identity to partitions  (Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Actually, index-based replica identities failed in pg_dump: we first
create the index ONLY on the partitioned table (marking it as invalid),
so when we immediately do the ALTER TABLE/REPLICA IDENTITY, it rejects
the invalid index.  If we change the code to allow invalid indexes on
partitioned tables to become replica identities, we hit the problem that
the index didn't exist when processing the partition list.  In order to
fix that, I added a flag so that partitions are allowed not to have the
index, in hopes that the missing index are created in subsequent
commands; those indexes should become valid & identity afterwards.

There's a small emerging problem, which is that if you have an invalid
index marked as replica identity, you cannot create any more partitions;
the reason is that we want to propagate the replica identity to the
partition, but the index is not there (since invalid indexes are not
propagated).  I don't think this case is worth supporting; it can be
fixed but requires some work[1].

New patch attached.

[1] In DefineRelation, we obtain the list of indexes to clone by
RelationGetIndexList, which ignores invalid indexes.  In order to
implement this we'd need to include invalid indexes in that list
(possibly by just not using RelationGetIndexList.)

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

Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Tighten up a few overly lax regexes in pg_dump's tap tests