propagating replica identity to partitions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема propagating replica identity to partitions
Дата
Msg-id 201902041630.gpadougzab7v@alvherre.pgsql
обсуждение исходный текст
Ответы Re: propagating replica identity to partitions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: propagating replica identity to partitions  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hello

If you do ALTER TABLE .. REPLICA IDENTITY to a partitioned table, the
command operates on the parent table itself and does not propagate to
partitions.  Why is this?  Maybe not recursing was the right call when
we only had regular inheritance (back in 9.4), but since partitioned
tables got introduced, I think it is completely the other way around:
not recursing is an usability fail.

At the same time, I think that psql failing to display the replica
identity for partitioned tables is just an oversight and not designed
in.

I propose to change the behavior to:

1. When replica identity is changed on a partitioned table, all partitions
   are updated also.  Do we need to care about regular inheritance?
   My inclination is not to touch those; this'd become the first case
   in ATPrepCmd that recurses on partitioning but not inheritance.

2. When a partition is created, the replica identity is set to the
   same that the parent table has.  If it's type index, figure out the
   corresponding index in the partition, set that.  If the index doesn't
   exist, raise an error (i.e. replica identity cannot be set to an
   index until it has propagated to all children).

3. psql should display replica identity for partitioned tables.

Thoughts?

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


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

Предыдущее
От: Alexey Kondratov
Дата:
Сообщение: Re: Too rigorous assert in reorderbuffer.c
Следующее
От: Andres Freund
Дата:
Сообщение: Memory contexts reset for trigger invocations