Re: ON CONFLICT DO UPDATE for partitioned tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ON CONFLICT DO UPDATE for partitioned tables
Дата
Msg-id 20180316182106.s7ag67mvwgghnyp2@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: ON CONFLICT DO UPDATE for partitioned tables  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: ON CONFLICT DO UPDATE for partitioned tables
Список pgsql-hackers
So ExecInsert receives the ModifyTableState, and separately it receives
arbiterIndexes and the OnConflictAction, both of which are members of
the passed ModifyTableState.  I wonder why does it do that; wouldn't it
be simpler to extract those members from the node?

With the patch proposed upthread, we receive arbiterIndexes as a
parameter and if the table is a partition we summarily ignore those and
use the list as extracted from the PartitionRoutingInfo.  This is
confusing and pointless.  It seems to me that the logic ought to be "if
partition then use the list in PartitionRoutingInfo; if not partition
use it from ModifyTableState".  This requires changing as per above,
i.e. make the arbiter index list not part of the ExecInsert's API.

The OnConflictAction doesn't matter much; not passing it is merely a
matter of cleanliness.

Or is there another reason to pass the index list?

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


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: PL/pgSQL nested CALL with transactions
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE for partitioned tables